@revealui/services
v0.7.12
Published
External service integrations, Stripe (payment processing + circuit breaker) and email (Gmail API delivery). Ships with RevealUI.
Maintainers
Readme
title: "@revealui/services" description: "External service integrations for RevealUI - Stripe (billing + circuit breaker) and Gmail API (transactional email)." visibility: public status: verified audience: user
@revealui/services
Commercial package - requires a RevealUI Pro license. Free to install and evaluate; a license key is required for production use.
External service integrations for RevealUI - Stripe (billing + circuit breaker) and Gmail API (transactional email).
Features
- Stripe Integration: Payment processing and billing operations with circuit breaker
- Email: Transactional email helpers
- Type-safe: Full TypeScript support
- Server surface: Root and
./serverexport the same server Stripe/email helpers (no distinct client Stripe bundle)
Installation
This package is published (publishConfig.access: public) and consumed in the monorepo via workspace:* references.
Usage
Server-side
import { protectedStripe } from '@revealui/services/server'
// Use Stripe (circuit breaker + retry protected)
const customer = await protectedStripe.customers.create({
email: '[email protected]',
name: 'Customer Name'
})Available Exports
Server-side integrations (Node.js / Hono routes):
- Root (
@revealui/services), re-exports Stripe + email - Server alias (
./server), same as root - Email helpers (
./email) - Stripe mode coherence check (
./stripe/mode) - Stripe payment intents (
./stripe/payment-intent) - Stripe client module (
./stripe/stripeClient), exportsgetStripe/protectedStripe, not a symbol namedstripeClient
Stripe Integration
import { protectedStripe, getStripe } from '@revealui/services/server'
// Create customer (circuit breaker + retry protected)
const customer = await protectedStripe.customers.create({
email: '[email protected]'
})
// Create payment intent
const paymentIntent = await protectedStripe.paymentIntents.create({
amount: 2000,
currency: 'usd',
customer: customer.id
})
// Create subscription
const subscription = await protectedStripe.subscriptions.create({
customer: customer.id,
items: [{ price: 'price_xxxxx' }]
})
// Raw Stripe SDK instance (no resilience wrapping)
const stripe = getStripe()Environment Variables
Required environment variables:
# Stripe
STRIPE_SECRET_KEY=sk_test_...Development
# Build package
pnpm --filter @revealui/services build
# Run tests
pnpm --filter @revealui/services test
# Watch mode
pnpm --filter @revealui/services dev
# Type check
pnpm --filter @revealui/services typecheckTesting
# Run all tests
pnpm --filter @revealui/services test
# Run tests in watch mode
pnpm --filter @revealui/services test:watch
# Run with coverage
pnpm --filter @revealui/services test:coverageRelated Documentation
- Environment Variables Guide - Service API keys setup
- Architecture - Service integration patterns
License
FSL-1.1-MIT (Fair Source, converts to MIT after 2 years). See LICENSE.
