📊
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
  2. pollTypes

getAll()

getAll(): Promise<PollType[]>

Get a list of all available poll types.

Returns:

  • A Promise resolving to an array of poll type objects (PollType).

Example:

try {
  const pollTypesList = await pollz.pollTypes.getAll();
  console.log('Poll Types List:', pollTypesList);
} catch (error) {
  console.error('Failed to retrieve poll types:', error.message);
}

The getAll method allows you to retrieve a list of all available poll types. It returns a Promise resolving to an array of poll type objects (PollType). Each poll type object includes an ID (id) and a name (name).

This method is useful for providing users with information about the available poll types they can use when creating new polls.

PreviouspollTypesNextTooling

Last updated 1 year ago