1. Authentication

Authentication

Authenticate your account by including your personal access token in API requests. The easiest way to get started is to create an OAuth2 token using the Storyblok App. Go to the My Account section at app.storyblok.com, and in the Personal Access token tab, click on “Generate new token”.

Your personal access token will grant anyone who obtains it access to all associated spaces for your account along with the space permissions, so make sure to never expose it on the client side or commit it in your source code. Use strategies like environment variables to secure your personal access token. If you have exposed your personal access token, make sure to delete it immediately from the My Account section and use a new one instead.

Using an OAuth2 token, a username and a password don’t need to be permanently stored and you can revoke access at any time.

Authorization for Apps

In order to Authenticate your Apps, make sure to add an "Authorization" header with your OAuth2 token.

Examples
curl -H "Authorization: YOUR_OAUTH_TOKEN" https://mapi.storyblok.com/
// npm install storyblok-js-client
const StoryblokClient = require('storyblok-js-client')

// Initialize the client with the oauth token
const Storyblok = new StoryblokClient({
  oauthToken: 'YOUR_OAUTH_TOKEN'
})