Authentication

In order to utilize our SDK we require all requests to be authenticated. You can view and manage your Antic API keys in the Antic Dashboard.

Your Antic API Key ID acts as your public key, and your Antic Secret API Key acts as the password for the public key. The JWT is an encoded mix of the two. Be sure to keep your secret key private.

How to Create a JWT Token

Here is sample code to help you create the JWT token using Antic Secret API Key

import { sign, SignOptions } from 'jsonwebtoken';

export function generateToken() {
  // information to be encoded in the JWT
  const payload = {
    partnerId: ANTIC_API_KEY
  };
  // read private key value
  const privateKey = ANTIC_SECRET_API_KEY; // replace with the Antic Secret API Key

  const signInOptions: SignOptions = {
    algorithm: 'RS256',
    expiresIn: '12h'
  };

  // generate JWT
  return sign(payload, privateKey, signInOptions);
};

The JWT token you generated will be used in our SDK as an Authorization header to authenticate all API requests made. It will be passed as a parameter when initializing the Group Buy Flow

πŸ‘

Talk to us!

Our product evolves and improves as you build on top of it, iterating quickly to help support new use cases and constantly optimizing for value. To do so effectively, we want your feedback. Any feedback is welcomed - good, bad, or neutral.
You can share your input via email at [email protected]

For tech questions, clarifications or god forbid issues, please utilize the Discussions tab


What’s Next