Developer docs
Build with PulseRouter
PulseRouter is BagsPulse's fee-routing layer on top of the official@bagsfm/bags-sdk. There is no separate npm package - you install the Bags SDK and use the BagsPulse partner registry to look up your fee_wallet at swap-time.
1. Install the real packages
npm install @bagsfm/bags-sdk @solana/web3.jsNote: @pulserouter/sdk does not exist on npm - PulseRouter is a hosted protocol, not a client SDK.
2. Register your app
Pick a unique app_id slug and your fee_wallet on thePulseRouter page. BagsPulse stores this mapping and uses it to inject your wallet into everycreateBagsFeeShareConfigcall routed through your app.
3. Launch tokens with the Bags SDK + your app_id
import { BagsSDK } from "@bagsfm/bags-sdk";
import { Connection } from "@solana/web3.js";
const sdk = new BagsSDK({
apiKey: process.env.BAGS_API_KEY!,
connection: new Connection(process.env.HELIUS_RPC_URL!),
});
// Resolve your registered split from BagsPulse
const partner = await fetch(
"https://bagspulse.lovable.app/api/public/agent/run?app_id=your-app-id"
).then((r) => r.json());
// Build a fee share config with creator + your app + protocol
const feeConfig = await sdk.config.createBagsFeeShareConfig({
payer: payerPubkey,
users: [
{ wallet: creatorPubkey, bps: 8000 }, // 80% creator
{ wallet: partner.fee_wallet, bps: 1500 }, // 15% your app
{ wallet: partner.treasury_wallet, bps: 500 }, // 5% protocol
],
});4. Claim accumulated fees
Use the in-app Claim my fees dialog on the PulseRouter page - it builds and signs the on-chain claim transaction with your connected wallet.
Resources
- · Bags docs · docs.bags.fm
- · Bags SDK · github.com/bagsfm/bags-sdk
- · Helius RPC · docs.helius.dev
- · Fee program ·
FEE2tBhCKAt7shrod19QttSVREUYPiyMzoku1mL1gqVK
Ready to launch? Open the marketplace →