Vote for a Poll
Guide: Voting in a Poll with pollz-js SDK
Prerequisites
Before you proceed with voting in a poll using the pollz-js SDK, ensure that you have already initialized the SDK and created a poll by following the relevant guides in the "Guides" section.
Vote in a Poll
Now that you have a poll created, users can cast their votes using the pollz-js SDK.
Step 1: Import the SDK
In your Node.js application, ensure you have already imported the pollz-js SDK:
Step 2: Vote in a Poll
Use the vote
method provided by the polls
module of the SDK to submit votes for a poll. Provide the poll type, poll ID, chosen option IDs, and the user ID.
Replace 'your-app-id' and 'your-app-secret' with the actual credentials obtained from the Pollz platform. Adjust the pollId
, optionIds
, and userId
according to your application's context.
Congratulations! Users can now cast their votes in the poll using the pollz-js SDK. Explore more SDK features and functionalities to enhance your application's polling experience. Refer to the relevant guides for detailed instructions on other SDK capabilities.
Last updated