New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dopt/blocks-javascript-client

Package Overview
Dependencies
Maintainers
5
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dopt/blocks-javascript-client

A generated JavaScript API client for Dopt's blocks API

  • 0.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by75%
Maintainers
5
Weekly downloads
 
Created
Source

Dopt's Blocks Javascript Client

Getting Started

The Dopt Blocks JavaScript Client is a friendly server-side and client-side package for accessing the Dopt Blocks API. This allows you to identify new blocks and update existing blocks with Dopt, so that they can interact with the flows created within the app.

Installation

Via Yarn:

yarn add @dopt/blocks-javascript-client

Via pnpm:

pnpm add @dopt/blocks-javascript-client

Via npm:

npm install @dopt/blocks-javascript-client

Configuration

To configure the Blocks JavaScript Client you will need

  1. A blocks API key (generated in Dopt)
  2. A user ID for the user you wish to identify (the same ID will be used in the React SDK)
  3. The properties you wish to store and/or update for the given user

Usage

Initialization
import { Configuration, BlocksApi } from "@dopt/blocks-javascript-client";

const doptBlocksClient = new BlocksApi(
  new Configuration({
    apiKey: "BLOCKS_API_KEY",
  })
);

Example Usage

Using the flowIntent API.

const uid = "example-flow-uid";
const version = 2;
const userIdentifier = "example-identified-user-identifier";
const groupIdentifier = "example-identified-group-identifier";
const flowIntent = "complete";
const includeBlock = true;

doptBlocksClient.flowIntent(
  version,
  userIdentifier,
  uid,
  flowIntent,
  groupIdentifier,
  includeBlock
);

Using the blockIntent API.

import { Configuration, BlocksApi } from "@dopt/blocks-javascript-client";

const doptBlocksClient = new BlocksApi(
  new Configuration({
    apiKey: "BLOCKS_API_KEY",
  })
);

const uid = "example-flow-uid";
const version = 2;
const userIdentifier = "example-identified-user-identifier";
const groupIdentifier = "example-identified-group-identifier";
const blockIntent = "complete";
const includeBlock = true;

doptBlocksClient.blockIntent(
  version,
  userIdentifier,
  uid,
  blockIntent,
  groupIdentifier
);

FAQs

Package last updated on 16 Feb 2023

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