Getting Started
Prerequisites and security best practices for VOTR integration
β οΈ IMPORTANT SECURITY NOTES
π Credential Security
NEVER store Client ID and Client Secret in your frontend code!
Security Best Practices
β DONβT DO THIS (Insecure):
// NEVER put credentials in frontend code
const CLIENT_ID = "184hc5luf27g" // β Exposed to users
const CLIENT_SECRET = "c1kf58bh43dnlq676j" // β Major security risk
β DO THIS (Secure):
// Frontend calls YOUR backend API
const getVotingUrl = async (userEmail: string, eventId: string) => {
const response = await fetch("/api/voting/generate-url", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${userAuthToken}`, // Your app's user auth
},
body: JSON.stringify({
email: userEmail,
eventId: eventId,
environment: "development", // Your backend uses: https://api-dev.govotr.com
}),
})
return response.json()
}
Recommended Architecture
Frontend (React/RN) ββ Your Backend API ββ GoVotr API
β β β
- VoteNowButton SDK - Client ID - OAuth Token
- User Interface - Client Secret - Voting URLs
- No Credentials - Secure Storage - User Validation
- Environment URLs - Development/Production
Backend Implementation (Your Server)
Your backend should handle all GoVotr API calls:
- Store credentials securely (environment variables, secret manager)
- Authenticate your users before making GoVotr API calls
- Validate user permissions for voting events
- Return only the voting URL to frontend
π For complete backend implementation examples, please refer to: Sample Repository
Prerequisites
What You Need
- Client ID and Client Secret (provided by Votr team)
- npm or yarn
- React or React Native project
What Votr Provides
govotr-vote-sdk-1.0.0.tgzfile- Client ID (e.g.,
184hc5luf27g) - Client Secret (e.g.,
c1kf58bh43dnlq676j)
Environment URLs
- Development:
https://api-dev.govotr.com - Production:
https://api.govotr.com
GitHub Repository
For complete implementation examples and backend code: π https://github.com/Govotr/Sample-IN-APP-Voting
Next Step: Install the SDK to start your integration.