Skip to content

PortalTechnologiesInc/lib

Repository files navigation

Portal

Nostr-based authentication and Lightning payments for your application.

Documentation License

Portal is a Nostr-based authentication and payment SDK allowing applications to authenticate users and process payments through Nostr and Lightning Network.


Table of contents


Features

Area Capabilities
Authentication Nostr key handshake, main keys and subkeys, no passwords. Users sign in with a Nostr wallet (e.g. NWC).
Payments Single and recurring Lightning payments; request invoices; Cashu mint, burn, request, and send.
Identity Fetch and set Nostr profiles; NIP-05 resolution; issue and verify JWTs for session management.
Platforms TypeScript/JavaScript and Java SDKs; React Native bindings; run the API yourself (Rust) or use a hosted endpoint.

Quick start

  1. Use an SDK — Install the TypeScript SDK or Java SDK, connect to a Portal endpoint, and call the API with your auth token.
  2. Or run the API — Self-host with Docker or build from source. Then use an SDK or connect to the WebSocket API.

Example (Docker):

docker run -d -p 3000:3000 \
  -e PORTAL__AUTH__AUTH_TOKEN=your-secret-token \
  -e PORTAL__NOSTR__PRIVATE_KEY=your-nostr-private-key-hex \
  getportal/sdk-daemon:latest

Use ws://localhost:3000/ws as the SDK WebSocket URL and your token for authentication. Health check: curl http://localhost:3000/health.


Documentation

Full documentation: https://portaltechnologiesinc.github.io/lib/

Section Contents
Getting Started Quick Start, Docker, environment variables, building from source
SDK Installation, basic usage, configuration, error handling, API reference
Guides Authentication, single/recurring payments, profiles, Cashu, JWT, relays
Resources FAQ, glossary, troubleshooting, contributing

SDKs & API

Component Description
TypeScript / JavaScript npm portal-sdk — Node and browser; source in this repo under crates/portal-rest/clients/ts.
Java Portal Java SDK — JVM (Java 17+); Gradle/Maven via JitPack.
Portal API REST + WebSocket server in this repo (crates/portal-rest). Run it yourself or use a hosted endpoint. API README.

Repository structure

Path Description
crates/portal-rest Portal API server (REST + WebSocket). README for running and configuration.
crates/portal-rest/clients/ts TypeScript SDK source. README.
crates/portal Core Portal library (Rust): protocol, conversation handling, router.
crates/portal-app, portal-sdk, portal-wallet, portal-cli, portal-rates App runtime, SDK core, wallet adapters, CLI tools, fiat rates.
react-native React Native bindings for Portal.
backend Example backend (TypeScript).
docs Documentation source (mdBook). Published to GitHub Pages.

License

MIT where noted. See LICENSE.

About

Portal protocol implementation in Rust

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 6