Understanding the SDK Usage
This page describes how to understand the main code pieces where the SDK is used and how for the Personalized Newsletter app.
SDK Initialization
import { HumanitySDK } from '@humanity-org/connect-sdk'
import { getConfig } from './config'
const config = getConfig()
export const sdk = new HumanitySDK({
clientId: config.humanity.clientId!,
redirectUri: config.humanity.redirectUri!,
environment: config.humanity.environment ?? 'sandbox',
clientSecret: config.humanity.clientSecret, // Optional for server-side operations
})Key Configuration Parameters:
The OAuth Flow
Step 1: Building the Authorization URL
What the SDK Returns:
Step 2: Handling the OAuth Callback
What the SDK Returns:
Step 3: Extracting User Data with the SDK
SDK Methods Used:
Step 4: Using the Query Engine for Complex Conditions
SDK Method:
Key Files Where SDK is Used
File
Purpose
SDK Methods Used
Data Flow Summary
Important Security Notes
Last updated