The Pluto React Native SDK provides components and functions for generating proofs in React Native applications.
To use any of the components or functions in this SDK, install the package:
npm install @plutoxyz/react-native-sdk
# or
yarn add @plutoxyz/react-native-sdk
After installing, for iOS projects, run pod install:
cd ios && pod install
Note: This SDK currently supports iOS only. Android support is planned for future releases.
- ProofGenerator - Complete solution for proof generation with UI
- RequestBuilder - Foundational component for manifest handling
- generateProof - Generate proofs from manifest objects
- generateProofFromUrl - Generate proofs from manifest URLs
- Types Reference - Detailed type definitions for manifests and related types
- RequestBuilder: A component for building and customizing requests with browser-based user interaction
- ProofGenerator: A component that combines RequestBuilder with proof generation
- Direct API functions: For programmatic proof generation
Platform | Support Status |
---|---|
iOS | ✅ Fully Supported |
Android | ❌ Not yet supported (planned for future releases) |
When used in an Android application, all methods and components will gracefully throw errors with clear messages indicating the lack of Android support. This ensures your cross-platform app doesn't crash, but you'll need to implement platform-specific logic to handle these cases.
import { Platform } from "react-native";
import { ProofGenerator } from "@plutoxyz/react-native-sdk";
// Only use the component on iOS
{
Platform.OS === "ios" && (
<ProofGenerator
manifestUrl="https://example.com/manifest.json"
onProofGenerated={(proof) => {
console.log("Proof generated:", proof);
}}
onError={(error) => {
console.error("Error:", error);
}}
/>
);
}
-
src/: Source code for the library
- components/: React components
RequestBuilder.tsx
: Wrapper for the Swift RequestBuilderProofGenerator.tsx
: Component that combines RequestBuilder with proof generation
- bridge/: Native bridging code
NativeBridge.tsx
: Bridge functions to the Swift SDK
- types/: TypeScript type definitions
- index.ts: Main entry point that exports everything
- components/: React components
-
example/: Example/test app
App.tsx
: Test application for the library
-
ios/: iOS native code
PLUTO_SWIFT_SDK/
: Reference files from the PlutoSwiftSDK pod
Contributions are welcome! Here's how you can contribute to this project:
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/react-native-pluto-sdk.git cd react-native-pluto-sdk
- Install dependencies:
npm install
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes and commit them:
git commit -m 'Add some amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
Please make sure your code follows the existing style and include appropriate tests.
To build the library:
npm run build
To run tests:
npm test
To try the example app:
# Navigate to the example directory
cd example
# Install dependencies
npm install
# Run the app on iOS
npm run ios
This library uses release-it to manage releases with automatic versioning and changelog generation.
To release a new version:
- Make sure all changes are committed and pushed
- Update the CHANGELOG.md file:
- Add a new section for the upcoming version at the top of the file
- Document all notable changes under appropriate categories (Added, Changed, Fixed, etc.)
- Follow the Keep a Changelog format
- Commit the changelog update:
git add CHANGELOG.md git commit -m 'Update changelog for version X.Y.Z'
- Run the release command:
npm run release
- Follow the prompts to choose the version type (major, minor, patch, or prerelease)
- The tool will automatically:
- Bump the version in package.json
- Create a git tag
- Push to GitHub
- Publish to npm
For a prerelease version (alpha/beta):
# For alpha releases
npm run release -- --preRelease=alpha
# For beta releases
npm run release -- --preRelease=beta