Consuming Addons
Install. Wire. Done.
Addons are npm packages. One import, one wireAddon call, and every function, service, and secret is available.
Namespaced functions
Every addon function is prefixed with the addon name — postgres:insert, stripe:charge — so there are never collisions.
Full type safety
Addon inputs and outputs are typed. Your IDE autocompletes addon function names, parameters, and return values.
Secret overrides
Addons declare the secrets they need. You provide the values in your environment or Console — the addon reads them transparently.
// Call addon functions via namespaced RPCs
const result = await rpc('postgres:insert', {
table: 'users',
data: { name: 'Alice', email: 'alice@example.com' }
})
// Addons declare secrets via wireSecret —
// you provide the values through your own secret store
await secrets.getSecretJSON('POSTGRES_URL')
Creating Addons
Build your own plugin
Package any set of functions, services, and secrets into a reusable addon that anyone can install.
// src/redis.secret.ts
wireSecret({
name: 'password',
displayName: 'Redis Password',
description: 'Redis authentication password',
secretId: 'REDIS_PASSWORD',
schema: z.string().optional(),
})
// src/services.ts
export const createSingletonServices =
pikkuExternalServices(async (config, { variables, secrets }) => {
const params = await variables.getJSON('REDIS_PARAMS')
const password = await secrets.getSecret('REDIS_PASSWORD')
return {
redis: new Redis({ host: params.host, password })
}
})
Standard npm package
An addon is a package with addon: true in pikku.config.json. It exports services, secrets, variables, and functions like any Pikku app.
pikkuExternalServices
Your service factory receives the host app's variables and secrets. Return the services your addon functions need — they're injected automatically.
Publish & share
Publish to npm. Consumers install, call wireAddon, and provide secret values — the addon does the rest.
Extend Pikku your way
Install community addons or build your own. Every addon is just an npm package.