scrive-sdk
v1.1.0
Published
Typescript-wrapper for Scrive API v2
Downloads
3
Maintainers
Readme
Scrive Typescript SDK
Use this to integrate with the Scrive API.
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!
Features
- ✅ Great test coverage
- 💁♂️ Inline documentation
- 🔒 Runtime type-checking
Documentation
To get started, install the NPM package.
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
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.