Installation

How to install and set up the VOTR SDK in your project

Step 1: Download SDK

📥 Download React Native SDK


Step 2: Install SDK

2.1 Add SDK Package

Place the downloaded SDK file in your project’s root directory.

2.2 Install Package

npm install ./govotr-vote-react-native-1.0.0.tgz --legacy-peer-deps

2.3 Import Component

import { VoteNowButton } from "@govotr/vote-react-native"

2.4 Test Installation

Create a test component to verify installation:

import React from "react"
import { VoteNowButton } from "@govotr/vote-react-native"
import { StyleSheet } from "react-native"

export default function TestComponent() {
  const styles = StyleSheet.create({
    button: {
      backgroundColor: "#5263FF",
      borderRadius: 12,
      alignItems: "center",
    },
    buttonText: {
      color: "white",
      fontSize: 18,
      fontWeight: "bold",
    },
  })

  return (
    <VoteNowButton
      URL=""
      label="Test Button"
      buttonStyle={styles.button}
      textStyle={styles.buttonText}
      isLoading={false}
    />
  )
}

Troubleshooting Installation

Common Issues

Issue: “Module not found” error after SDK installation

Solution:

# Clear npm cache and reinstall
npm cache clean --force
rm -rf node_modules package-lock.json
npm install

# Reinstall React Native SDK:
npm install ./govotr-vote-react-native-1.0.0.tgz --legacy-peer-deps

Issue: Peer dependency warnings

Solution:

The --legacy-peer-deps flag is required for this package. This is normal and expected.

Issue: TypeScript errors

Solution:

If you’re using TypeScript, you may need to add type declarations. The SDK includes its own TypeScript definitions.

Next Steps

Once the SDK is installed successfully, you can proceed to:

  1. Set up OAuth authentication
  2. Generate voting URLs
  3. Use the SDK component

Next Step: API Reference to learn how to use the SDK.