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 - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

2

package.json
{
"name": "@dopt/blocks-javascript-client",
"version": "0.0.6",
"version": "0.0.7",
"private": false,

@@ -5,0 +5,0 @@ "description": "A generated JavaScript API client for Dopt's blocks API",

@@ -1,3 +0,97 @@

## BlocksJavascriptClient
# Dopt's Blocks Javascript Client
Some guidance for writing great READMEs can be found (here)[https://www.makeareadme.com/]
## 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:
```bash
yarn add @dopt/blocks-javascript-client
```
Via pnpm:
```bash
pnpm add @dopt/blocks-javascript-client
```
Via npm:
```bash
npm install @dopt/blocks-javascript-client
```
### Configuration
To configure the Blocks JavaScript Client you will need
1. A blocks API key (generated in Dopt)
1. A user ID for the user you wish to identify (the same ID will be used in the React SDK)
1. The properties you wish to store and/or update for the given user
### Usage
#### Initialization
```typescript
import { Configuration, BlocksApi } from "@dopt/blocks-javascript-client";
const doptBlocksClient = new BlocksApi(
new Configuration({
apiKey: "BLOCKS_API_KEY",
})
);
```
#### Example Usage
Using the `flowIntent` API.
```typescript
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.
```typescript
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
);
```
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