Skip to main content

Installation

Step 1: Download the SDK​

Download the React Native SDK

The SDK is distributed as a downloaded package. It is not published on npm.


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​

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

2.3 Import the component​

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

2.4 Test the installation​

Create a test component to verify the install:

TestComponent.tsx
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}
/>
);
}

This only confirms the package installs and compiles. With an empty URL the button renders but does nothing. The voting flow runs once you pass a real voting URL from the Voting endpoint.

Troubleshooting Installation​

"Module not found" error after SDK installation​

Terminal — recover from a broken install
# 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 its own type definitions, which reference types from react and react-native. React Native 0.71 and later bundles its own types, so do not install @types/react-native. The only type package you need is @types/react, which every TypeScript React Native project already has.

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