📊
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. anonymous

getAnonymousPoll()

getAnonymousPoll(pollToken: string): Promise<PollWithOptions>

Retrieve an anonymous poll using the provided poll token.

Parameters:

  • pollToken (string): The anonymous voting token for the desired poll.

Returns:

  • A Promise resolving to the poll object (PollWithOptions) associated with the provided poll token.

Example:

const anonymousPoll = await pollz.anonymous.getAnonymousPoll('your-anonymous-token');
console.log('Anonymous Poll:', anonymousPoll);

The getAnonymousPoll method allows you to retrieve information about an anonymous poll using the anonymous voting token associated with that poll. This is particularly useful for displaying the results of anonymous votes or providing real-time updates for anonymous participation.

Note: Ensure that the provided pollToken is valid and corresponds to an existing anonymous voting session.

PreviouscreateAnonymousToken()NextvoteAnonymously()

Last updated 1 year ago