scrive-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Scrive Typescript SDK

lifecycle NPM version codecov npm bundle size

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.

Package Sidebar

Install

npm i scrive-sdk

Weekly Downloads

2

Version

1.1.0

License

Apache-2.0

Unpacked Size

126 kB

Total Files

35

Last publish

Collaborators

  • simenandre