Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/klaviyo-enterprise-rbac

@0d57af8
Run it yourself

Configure Klaviyo enterprise access control with API key scopes and OAuth. Use when implementing per-key scoping, configuring OAuth app authorization, or setting up organization-level access controls for Klaviyo. Trigger with phrases like "klaviyo scopes", "klaviyo RBAC", "klaviyo enterprise", "klaviyo permissions", "klaviyo OAuth", "klaviyo access control".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/klaviyo-enterprise-rbac

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesexamples.md

≈697 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Klaviyo Enterprise RBAC — Worked Examples

Concrete scenarios showing how the scoped-key + application-RBAC model from SKILL.md and references/implementation.md plays out in practice.

Example 1: Least-privilege key per service

A reporting dashboard should never be able to send campaigns or write profiles. Give it a read-only key and let the RBAC layer refuse anything else.

// Reporting Dashboard -- read-only
// Key scopes: campaigns:read, metrics:read, segments:read, profiles:read
const reportingSession = new ApiKeySession(process.env.KLAVIYO_KEY_REPORTING!);

Result: even if application code accidentally calls a write endpoint, Klaviyo returns 403 permission_denied because the key lacks the scope — defence in depth beyond the app-level checkPermission guard.

Example 2: Gating a route by permission

The marketer role can send campaigns but must not delete profiles. The middleware enforces this before the handler runs.

// Marketer hits this — allowed (canSendCampaigns: true)
app.post('/api/klaviyo/campaigns/send',
  requireKlaviyoPermission('canSendCampaigns'),
  campaignSendHandler
);

// Marketer hits this — blocked with 403 (canDeleteProfiles: false)
app.delete('/api/klaviyo/profiles/:id',
  requireKlaviyoPermission('canDeleteProfiles'),
  profileDeleteHandler
);

The blocked request returns:

{
  "error": "Forbidden",
  "message": "Role 'marketer' does not have permission: canDeleteProfiles"
}

Example 3: Resolving a session from a role

Map an authenticated user's role to the correctly-scoped API key at request time.

const role = req.user.klaviyoRole as AppRole;   // e.g. 'developer'
const session = getSessionForRole(role);         // uses KLAVIYO_KEY_DEVELOPER
// session now carries only the developer scopes: profiles:*, events:*, lists:*, webhooks:*, templates:*

If no key is configured for the role, getSessionForRole throws No API key configured for role: <role> — fail closed rather than fall back to an over-privileged key.

Example 4: OAuth scope minimization for a marketplace app

A third-party integration should request only the scopes it uses. Requesting profiles:read profiles:write events:write lists:read (not all scopes) keeps the consent screen honest and limits blast radius if the token leaks.

scopes: ['profiles:read', 'profiles:write', 'events:write', 'lists:read'],

Example 5: Alerting on a destructive action

The audit trail flags profile deletions in real time so a compromised admin key does not silently wipe data.

if (entry.action === 'DELETE' && entry.resource.includes('profile')) {
  await alertSecurityTeam(`Profile deletion by ${entry.userId} (${entry.role})`);
}

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides a legitimate framework for implementing Klaviyo RBAC and OAuth authentication. It follows security best practices like using environment variables for secrets and least-privilege API scoping. A minor risk is noted regarding the processing of user roles, which is common for skills handling authentication data.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 months ago
What it can do
Reads files Edits files
version
1.7.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "saas",
  "klaviyo",
  "email-marketing",
  "cdp"
]
All 2 allowed tools
ReadWrite
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/klaviyo-enterprise-rbac