Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arafatamim/rescript-contentful
ReScript bindings for contentful.js
https://github.com/arafatamim/rescript-contentful
bucklescript contentful rescript
Last synced: 4 months ago
JSON representation
ReScript bindings for contentful.js
- Host: GitHub
- URL: https://github.com/arafatamim/rescript-contentful
- Owner: arafatamim
- License: mit
- Created: 2021-11-29T23:05:05.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-02T14:08:18.000Z (6 months ago)
- Last Synced: 2024-09-30T13:06:29.499Z (4 months ago)
- Topics: bucklescript, contentful, rescript
- Language: ReScript
- Homepage:
- Size: 40 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rescript-contentful
[![npm](https://img.shields.io/npm/v/rescript-contentful?color=%23CC3534&logo=npm)](https://www.npmjs.com/package/rescript-contentful)
![npm](https://img.shields.io/npm/dm/rescript-contentful)ReScript bindings (FFI) for [contentful.js](https://github.com/contentful/contentful.js), the JavaScript library for interacting with Contentful's Delivery API.
## Installation
Run `npm install rescript-contentful contentful`, and then update the `bs-dependencies` key in your `rescript.json` file to include "rescript-contentful".## Usage
```rescript
open Contentful// Create a Contentful client instance
let client = createClient({
accessToken: "",
space: "",
})// Fetch an entry
// client is piped to the first
// argument of the function
client
->getEntry(id)
->Promise.then(entry => { /* do something */ })// Fetch an asset
client
->getAsset(id, ())
->Promise.then(asset => { /* do something */ })
```See [DOCUMENTATION.md](https://github.com/arafatamim/rescript-contentful/blob/main/DOCUMENTATION.md) for a more detailed outline of the API.
## License
MIT Licensed. Full text available in the [LICENSE](https://github.com/arafatamim/rescript-contentful/blob/main/LICENSE) file.