Skip to content

Initialization

Function Signature

function createDripsSdk(
  blockchainClient: SupportedBlockchainClient,
  ipfsMetadataUploaderFn?: IpfsMetadataUploaderFn<Metadata>,
  options?: DripsSdkOptions
): DripsSdk;

Parameters

ParameterTypeRequiredDescription
blockchainClientSupportedBlockchainClientBlockchain client for network interaction
ipfsMetadataUploaderFnIpfsMetadataUploaderFn<Metadata>⚠️Required for write operations only
optionsDripsSdkOptionsOptional configuration

Options Configuration

The options parameter allows you to customize the SDK's behavior:

type DripsSdkOptions = {
  readonly graphql?: {
    readonly url?: string;
    readonly apiKey?: string;
  };
};
OptionTypeDefaultDescription
options.graphql.urlstringDrips production API deploymentCustom GraphQL endpoint URL
options.graphql.apiKeystringundefinedAPI key for authenticated GraphQL requests
Example Usage:
const sdk = createDripsSdk(blockchainClient, ipfsUploader, {
  graphql: {
    url: 'https://custom-drips-api.com/graphql',
    apiKey: 'your-api-key',
  },
});

For detailed GraphQL configuration examples, see the GraphQL Configuration section.