Fulcrum SDK

Fulcrum SDK Documentation

Installation

To get started, you'll need to install the Fulcrum SDK package. You can do this using npm or yarn:

npm install getfulcrum-sdk

or

yarn add getfulcrum-sdk

Example

Importing Fulcrum SDK

First, import the necessary modules from the Fulcrum SDK:

import  fulcrumSDK, {
  Segments,
  queryUser,
  setApiKey,
} from  "getfulcrum-sdk";

Setting the API Key

After importing, set your API key:

setApiKey(YOUR_API_KEY);

Preparing Data for Query

Prepare your query data:

const data = [
  // ... Your query objects here
];

Calling the Query Function

Finally, call the queryUser function:

queryUser(data, userId)
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.log(error);
  });

Description

Fulcrum SDK Query Types

Segments

  • Description: Check if the user exists in one or more segments.
  • Parameters:
    • string[]: Array of segment names.

Fulcrum SDK Methods

setApiKey(YOUR_API_KEY)

  • Description: Sets the API key for the SDK.
  • Return Type: void

queryUser(Object[], userId)

  • Description: Checks if the user matches the provided query.
  • Parameters:
    • Object[]: Array of Fulcrum query types.
    • userId: string - Provided user ID.
  • Return Type: boolean or error
    • true: User exists and matches the query.
    • false: User does not exist or does not match the query.
  • Throws: Custom error object (statusCode, statusName, description).