Class: TorqueAudienceClient
@torque-labs/torque-ts-sdk • Docs
@torque-labs/torque-ts-sdk / TorqueAudienceClient
Class: TorqueAudienceClient
The TorqueAudienceClient class is used to manage and verify audiencess for the Torque API.
Example
const client = new TorqueAudienceClient(TorqueAudienceClientOptions);
const audience = await client.buildAudience(<audienceData>);
const verified = await client.verifyAudience(audience);Constructors
new TorqueAudienceClient()
new TorqueAudienceClient(options): TorqueAudienceClientCreate a new instance of the TorqueAdminClient class with the provided API key.
Parameters
Returns
Defined in
Properties
client
userClient
undefined | TorqueUserClient
Methods
buildAudience()
buildAudience(options): Promise<AudienceBuildResponse>Builds an audience with the provided options.
Parameters
Returns
Promise<AudienceBuildResponse>
The response from the API.
Throws
If there is an error building the audience.
Defined in
logout()
logout(): Promise<void>Returns
Promise<void>
Defined in
verifyAudience()
verifyAudience(audience, publicKey?): Promise<boolean>Verifies the current user with the provided audience.
Parameters
publicKey?
string
-
Returns
Promise<boolean>
True if the user is verified with the audience, false otherwise.
Throws
If there is an error verifying the user with the audience.
Defined in
Last updated