https://github.com/arafatamim/rescript-contentful
ReScript bindings for contentful.js
https://github.com/arafatamim/rescript-contentful
bucklescript contentful rescript
Last synced: 3 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 (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-02T14:08:18.000Z (11 months ago)
- Last Synced: 2025-03-18T13:14:24.777Z (3 months ago)
- Topics: bucklescript, contentful, rescript
- Language: ReScript
- Homepage:
- Size: 40 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rescript-contentful
[](https://www.npmjs.com/package/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.