📊
Pollz
  • Introduction
  • Quickstart
  • Guides
    • Initializing your app
    • Create a Poll
    • Vote for a Poll
    • Retrieve a Poll
    • Manage Poll Options
    • Listen to update
    • Anonymous Poll
  • Components
    • React
    • React Native
    • Embedded
  • API Reference
    • init()
    • pollOptions()
      • addOption()
      • deleteOption()
      • renameOption()
    • anonymous
      • createAnonymousToken()
      • getAnonymousPoll()
      • voteAnonymously()
    • polls
      • create()
      • get()
      • getAll()
      • vote()
      • rename()
      • deleteOne()
      • listen()
    • pollTypes
      • getAll()
  • Tooling
    • Typescript
    • React
      • usePoll()
      • usePolls()
      • usePollz()
      • usePollTypes()
      • useAnonymousPoll()
Powered by GitBook
On this page
  1. API Reference

init()

init(input: InitInput): Promise<void>

Initialize the SDK with the provided application credentials.

const pollz = new PollzSDK();
const initInput = {
  appId: 'your-app-id',
  appSecret: 'your-app-secret',
};

try {
  await pollz.init(initInput);
  console.log('pollz-js SDK initialized successfully!');
} catch (error) {
  console.error('Failed to initialize pollz-js SDK:', error.message);
}
PreviousAPI ReferenceNextpollOptions()

Last updated 1 year ago