tronic-sdk
v2.2.6
Published
@tronic/tronic-sdk - Now with staging workflow support
Readme
Tronic JavaScript SDK
The Tronic JavaScript SDK empowers developers to provide frictionless web3 onboarding to their end-users while preserving their security and privacy using non-custodial wallets.
📖 Documentation
- Configuration Guide - Complete setup and configuration options
- Usage Examples - Practical examples for all features
- API Reference - Full TypeScript API documentation
- Changelog - Version history and migration guides
- Quality Audit - Technical architecture and metrics
⚡️ Quick Start
Installation
Integrating your app with Tronic will require our client-side NPM package:
# Via NPM:
npm install --save tronic-sdk # If you're targeting web browsers
# Via Yarn:
yarn add tronic-sdk # If you're targeting web browsersAlternatively, you can load via CDN by adding a script tag to your app's <head>:
<script src="https://cdn.jsdelivr.net/npm/tronic-sdk/dist/tronic.js"></script>Usage
Sign up or log in to the developer dashboard to receive API keys that will allow your application to interact with Tronic's APIs.
import { Tronic } from '@tronic/tronic-sdk';
const tronic = new Tronic('YOUR_API_KEY', { endpoint: 'https://your-endpoint.tronic.app' });
await tronic.wallet.showUI();View Management
The SDK provides methods to control the iframe visibility:
// Show the iframe
await tronic.view.showView();
// Hide the iframe
await tronic.view.hideView();
// Toggle iframe visibility
await tronic.view.toggleVisibility();
// Check if the view is currently visible
const isVisible = tronic.view.isViewVisible();📦 Package Ecosystem
Entry points
These are packages you can install to enable Tronic JS SDK functionality for your client-side application.
| Package Name | Changelog | Description |
| -------------------------------------------------------- | ----------------------------------------------- | --------------------------------------- |
| tronic-sdk | CHANGELOG | Web/browser entry-point for Tronic SDK. |
Extensions
Extend Tronic JS SDK functionality for your use-case through custom extension packages.
Internals
These are packages Tronic JS SDK uses internally to work seamlessly across platforms.
| Package Name | Changelog | Description |
| -------------------------------------------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| @tronic/types | CHANGELOG | Core typings shared between JavaScript entry-points of Tronic SDK. |
| @tronic/provider | CHANGELOG | Core business logic shared between JavaScript entry-points of Tronic SDK. |
| @tronic/commons | CHANGELOG | Exposes a listing of common public APIs from @tronic/provider and @tronic/types to the platform-specific entry points. |
| @tronic/types | CHANGELOG | Core typings for Tronic SDK packages. |
🚦 Testing
Run tests for all packages
yarn testTest an individual package
PKG=tronic-sdk yarn testTest specific files
yarn test /test/**/constructor.spec.ts