Socket
Socket
Sign inDemoInstall

@dynamic-labs/sdk-api

Package Overview
Dependencies
Maintainers
2
Versions
522
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dynamic-labs/sdk-api

API SDK for app.dynamic.xyz


Version published
Weekly downloads
4.1K
decreased by-27.05%
Maintainers
2
Weekly downloads
 
Created
Source

sdk-api

This library contains a generated TypeScript client using openapi. It can be used with any Javascript/Typescript project.

Documentation on the current set of REST APIs can be found at: https://docs.dynamic.xyz/api-reference/overview

APIs

  • SdkApi
    • These are endpoints used exclusively by the Dynamic React SDK. Several endpoints in these APIs require a JWT created by the verify or signin endpoints, and are specific to a user in the SDK's environment. These APIs are typically used on a client site or frontend to enhance their customers' experience.
  • Dashboard APIs
    • These endpoints are used by admins of an organization to update site settings and manage users of the environment. These APIs require an API token scoped for a specific environment. These APIs are typically used on a client backend, to manage all their users' data and make corresponding settings changes that affect all users of a site.
    • The most commonly used API among the dashboard APIs is UsersApi
    • You can read about all the other available APIs here

Examples

This section provides an example of how to use SDKApi. This would be similar to using the other available generated APIs, like UsersApi or ExportsApi, etc.

SdkApi

Initialize a new instance of the SDKApi class:

import { Configuration, SDKApi } from '@dynamic-labs/sdk-api';

const sdkApi = (jwt: string) => {
  const settings = {
    basePath: ApiEndpoint.getBaseUrl(),
    headers: {
      'Content-Type': 'application/json',
    },
  };
  settings.headers.Authorization = `Bearer ${jwt}`;
  return new SDKApi(new Configuration(settings));
};

Then you would be able to use it like this:

const response = await sdkApi(jwt).updateSelf({
  environmentId,
  userFields: fields, // { alias, firstName, lastName, username, ... }
});
// do something with the response

FAQs

Package last updated on 24 Jul 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc