Back
Paddle Wrapper

Paddle Wrapper

Overview

Paddle Wrapper

Paddle is the leading Merchant of Record for digital product companies. It handles payments, subscriptions, tax, compliance, and fraud for more than 6,000 SaaS, AI, and app companies worldwide, replacing the need for a complex, fragmented payment stack.

The Paddle Wrapper brings your billing data into Postgres as queryable foreign tables. Query and write products, customers, subscriptions, transactions, and more with plain SQL and join them against your application data. The wrapper works with Supabase Vault for secure API key management and is built on WebAssembly (Wasm) for lightweight, sandboxed execution.

Supported Operations

ObjectSelectInsertUpdateDelete
Products
Prices
Discounts
Customers
Transactions
Reports
Notification Settings
Notifications

Preparation

Before you get started, make sure the wrappers extension is installed on your database:


_10
create extension if not exists wrappers with schema extensions;

and then enable the Wasm foreign data wrapper:


_10
create foreign data wrapper wasm_wrapper
_10
handler wasm_fdw_handler
_10
validator wasm_fdw_validator;

Secure your credentials (optional)

By default, Postgres stores FDW credentials inside pg_catalog.pg_foreign_server in plain text. Anyone with access to this table will be able to view these credentials. Wrappers is designed to work with Vault, which provides an additional level of security for storing credentials. We recommend using Vault to store your credentials.


_10
select vault.create_secret(
_10
'<Paddle API key>',
_10
'paddle',
_10
'Paddle API key for Wrappers'
_10
);

Connecting to Paddle

We need to provide Postgres with the credentials to access Paddle, and any additional options. We can do this using the create server command:

With Vault:


_10
create server paddle_server
_10
foreign data wrapper wasm_wrapper
_10
options (
_10
fdw_package_url 'https://github.com/supabase/wrappers/releases/download/wasm_paddle_fdw_v0.2.0/paddle_fdw.wasm',
_10
fdw_package_name 'supabase:paddle-fdw',
_10
fdw_package_version '0.2.0',
_10
fdw_package_checksum 'e788b29ae46c158643e1e1f229d94b28a9af8edbd3233f59c5a79053c25da213',
_10
api_url 'https://sandbox-api.paddle.com', -- Use https://api.paddle.com for live account
_10
api_key_id '<key_ID>' -- The Key ID from above.
_10
);

Without Vault:


_10
create server paddle_server
_10
foreign data wrapper wasm_wrapper
_10
options (
_10
fdw_package_url 'https://github.com/supabase/wrappers/releases/download/wasm_paddle_fdw_v0.2.0/paddle_fdw.wasm',
_10
fdw_package_name 'supabase:paddle-fdw',
_10
fdw_package_version '0.2.0',
_10
fdw_package_checksum 'e788b29ae46c158643e1e1f229d94b28a9af8edbd3233f59c5a79053c25da213',
_10
api_url 'https://sandbox-api.paddle.com', -- Use https://api.paddle.com for live account
_10
api_key 'bb4e69088ea07a98a90565ac610c63654423f8f1e2d48b39b5'
_10
);

Note: the fdw_package_* options are required and specify the Wasm package metadata. See the Available Versions table above for the full list.

Resources

Details

DeveloperSupabase
DocumentationLearn

Third-party integrations and docs are managed by Supabase partners.

Get started with Paddle Wrapper and Supabase.