xero-integration-multi-account

Implement multi-tenant OAuth 2.0 flows for Xero API integration in serverless environments.

42|8|Updated Aug 11, 2025
One-click install
npx skills add https://github.com/XeroAPI/xero-prompt-library --skill xero-integration-multi-account
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xero-integration-multi-account
Source: https://github.com/XeroAPI/xero-prompt-library/tree/main/lovable/xero-integration-multi-account
Command: npx skills add https://github.com/XeroAPI/xero-prompt-library --skill xero-integration-multi-account

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the complexity of building multi-tenant SaaS applications where each end user must connect their own Xero organization, handling the difficult requirements of OAuth 2.0, token rotation, and secure storage.

Core Features & Use Cases

  • Multi-tenant OAuth Lifecycle: Manages the full authorize-callback-refresh flow for multiple independent Xero accounts.
  • Secure Token Management: Implements AES-256-GCM encryption for per-user token storage in Postgres with Row Level Security.
  • Production Guardrails: Includes robust error handling for redirect URI mismatches, scope management, and idempotent write operations.

Quick Start

Load this skill into your AI agent to generate the server-side OAuth handlers and database schema required for a multi-tenant Xero integration on Lovable Cloud.

Frequently Asked Questions about xero-integration-multi-account

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle OAuth 2.0 token rotation for multiple Xero accounts in a SaaS application?

You handle multi-tenant Xero OAuth 2.0 token rotation by implementing refresh token management and secure database persistence. This ensures each tenant's connection remains active without requiring repeated manual reauthorization.

What's the best way to store Xero API access tokens securely in a multi-tenant environment?

Store Xero API access tokens securely by applying AES-256-GCM encryption for per-user token storage in Postgres. Combine this with Row Level Security to isolate tenant data and prevent unauthorized cross-account access.

Does this Xero API integration support serverless environments and granular scope selection?

Yes, this Xero API integration supports serverless environments and granular scope selection. It manages the full OAuth lifecycle including CSRF protection and redirect URI handling without requiring persistent server infrastructure.

How do I implement a multi-tenant Xero OAuth callback flow with CSRF protection?

Implement a multi-tenant Xero OAuth callback flow by handling the authorize-callback-refresh sequence with built-in CSRF protection. This validates state parameters and manages redirect URI mismatches to secure the authentication process.

Why does my Xero API integration fail with redirect URI mismatches in a multi-tenant setup?

Xero API integrations fail with redirect URI mismatches when callback URLs do not match registered app configurations. This integration provides production-grade error handling to detect and resolve these multi-tenant connection conflicts.