Skip to main content

Installation

Step 1: Download the SDK

Download the React Native SDK


Step 2: Install the SDK

2.1 Add the SDK package

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

2.2 Install the package

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

2.3 Import the component

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

2.4 Test the installation

Create a test component to verify the install:

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

"Module not found" error after SDK installation

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

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

Peer dependency warnings

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

TypeScript errors

The SDK ships with its own TypeScript definitions. If you're using TypeScript and still get errors, you usually do not need to add @types/react-native separately.

Next Steps

Once the SDK is installed:

  1. Set up OAuth authentication
  2. Generate voting URLs
  3. Use the VoteNowButton component (props reference: SDK Props)

Next: API Integration Overview