
Product
Announcing Bun and vlt Support in Socket
Bringing supply chain security to the next generation of JavaScript package managers
@prezly/sdk
Advanced tools
npm install --save @prezly/sdk
# or yarn
yarn add @prezly/sdk
Using ES Modules:
import { createPrezlyClient } from '@prezly/sdk';
const prezlyClient = createPrezlyClient({
accessToken: 'your-access-token',
});
Or Using CommonJS:
const { createPrezlyClient } = require('@prezly/sdk').default;
const prezlyClient = createPrezlyClient({
accessToken: 'your-access-token',
});
At this moment, the UI does not support issuing API tokens. Please contact support to issue one for you.
fetch API support@prezly/sdk is using fetch to create requests. We assume that the environment running the code supports it.
We understand that some of the environments, such as node.js or old browsers, do not support fetch. This can be resolved by including a polyfill.
whatwg-fetchnpm install --save whatwg-fetch
# or yarn
yarn add whatwg-fetch
import 'whatwg-fetch';
// ...
import { createPrezlyClient } from '@prezly/sdk';
We recommend referring to the official whatwg-fetch module documentation for more information.
node-fetchnpm install --save node-fetch
# or yarn
yarn add node-fetch
global.fetch = require('node-fetch');
// ...
const { createPrezlyClient } = require('@prezly/sdk');
We recommend referring to the official node-fetch module documentation for more information.
cross-fetchnpm install --save cross-fetch
# or yarn
yarn add cross-fetch
Using ES Modules:
import 'cross-fetch/polyfill';
// ...
import { createPrezlyClient } from '@prezly/sdk';
Or Using CommonJS:
require('cross-fetch/polyfill');
// ...
const { createPrezlyClient } = require('@prezly/sdk');
We recommend referring to the official cross-fetch module documentation for more information.
fetch implementationAdditionally, you can initialize the API client with your own implementation of fetch:
import { createPrezlyClient } = from '@prezly/sdk';
const prezlyClient = createPrezlyClient({
accessToken: 'your-access-token',
fetch: customFetch,
});
FAQs
Prezly API SDK
We found that @prezly/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Bringing supply chain security to the next generation of JavaScript package managers

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies

Product
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.