Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simenandre/scrivejs
https://github.com/simenandre/scrivejs
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/simenandre/scrivejs
- Owner: simenandre
- License: apache-2.0
- Created: 2022-02-04T22:59:08.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-22T20:33:28.000Z (about 1 month ago)
- Last Synced: 2024-11-30T21:43:30.466Z (22 days ago)
- Language: TypeScript
- Size: 359 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Scrive Typescript SDK
[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![NPM version](https://img.shields.io/npm/v/scrive-sdk.svg)](https://www.npmjs.com/package/scrive-sdk)
[![codecov](https://codecov.io/gh/cobraz/scrivejs/branch/main/graph/badge.svg)](https://codecov.io/gh/cobraz/scrivejs)
![npm bundle size](https://img.shields.io/bundlephobia/min/scrive-sdk)Use this to integrate with the [Scrive API][scrive-docs].
**Note**: Don't expect full coverage for the API, as there is no code generating
involved; we add features as we go. Contributions are very welcome![scrive-docs]: https://apidocs.scrive.com/
## Features
- ✅ Great test coverage
- 💁♂️ Inline documentation
- 🔒 Runtime type-checking## Documentation
To get started, install the NPM package.
```shell
yarn add scrive-sdk
```Let's look at an example where we are creating a new document based on a
template.**Tip**: In the Scrive UI, you'll find the ID as the numeric value in the URL.
Let's say the URL to the document is `https://scrive.com/d/9222321123123`, then
the ID is `9222321123123```typescript
import { ScriveSdk } from 'scrive-sdk';const client = ScriveSdk.usePersonalAccessCredentials({
apitoken: 'something',
accesstoken: 'is-something',
apisecret: 'when-there-nothing',
accesssecret: 'here',
});client.prepare().newDocumentFromTemplate('9222321123123');
```The SDK provides a way to construct the SDK class based on which way you are
going to authenticate with the API. For now, we only support _personal access
credentails_ as shown above, but I imagine this will look very similar once
OAuth is added too.