Skip to content
Knack Auth logo

Knack Auth

Handles API key and user token authentication for secure Knack API access. Manages session creation, refresh, and credential validation.

SKILL.md

Full skill instructions

Knack Auth

Purpose

Handles API key and user token authentication for secure Knack API access. Manages session creation, refresh, and credential validation.

Authentication Methods

1. API Key Authentication (Server-Side)

Use: Backend operations, automated reporting, data sync

Headers:

{
  "X-Knack-Application-Id": process.env.KNACK_APP_ID,
  "X-Knack-REST-API-Key": process.env.KNACK_API_KEY
}

Permissions: Full read/​write access to all objects

2. User Token Authentication (User-Specific)

Use: Dashboard views with user-level permissions

Headers:

{
  "X-Knack-Application-Id": process.env.KNACK_APP_ID,
  "Authorization": user_token
}

Core Functions

login_user

Endpoint: POST /​v1/​applications/​{app_id}/​session

Payload:

{
  "email": "[email protected]",
  "password": "secure_password"
}

Response:

{
  "session": {
    "user": {
      "id": "user_123",
      "token": "abc123xyz..."
    }
  }
}

Example:

const session = await login_user({
  email: "[email protected]",
  password: process.env.ADMIN_PASSWORD
});

const user_token = session.session.user.token;

refresh_token

Purpose: Renew expired user sessions automatically

Logic:

  • User tokens expire after 24 hours
  • Monitor token age
  • Auto-refresh before expiration
  • Store refreshed token securely

Example:

if (isTokenExpired(current_token)) {
  const new_token = await refresh_token(current_token);
  updateStoredToken(new_token);
}

validate_credentials

Purpose: Verify API key and app ID before operations

Check:

const isValid = await validate_credentials({
  app_id: process.env.KNACK_APP_ID,
  api_key: process.env.KNACK_API_KEY
});

Environment Variables

Required in .env:

KNACK_APP_ID=your_app_id
KNACK_API_KEY=your_api_key
[email protected]
ADMIN_PASSWORD=secure_password

Security Best Practices

  1. Never commit credentials to version control
  2. Use environment variables for all secrets
  3. Rotate API keys quarterly (align with QAR schedule)
  4. Limit user token lifespan to 24 hours
  5. Log authentication failures for audit trail

HTI-Specific Roles

Admin Users

  • Full CRUD access
  • Grant reporting permissions
  • Donor management

Volunteer Users

  • Read-only access to training materials
  • Event check-in capabilities

Public Dashboard

  • API key auth only
  • No user-specific data

Error Handling

try {
  const token = await login_user(credentials);
} catch (error) {
  if (error.status === 401) {
    console.error("Invalid credentials");
  } else if (error.status === 429) {
    console.error("Rate limit exceeded - retry after delay");
  }
}

Integration Points

  • knack_reader: Provides auth headers
  • knack_realtime: Maintains user sessions for webhooks
  • knack_reporting_sync: Admin-level access for report generation
  • knack_devops: Manages credential rotation in CI/​CD

Grant Compliance

  • Audit logs required for NCDIT reporting
  • Track all admin access to donation/​device data
  • Maintain separation between operational and financial data access

More DevOps & CI/CD skills

Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.

6K 472.6K
View

Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.

6K 472.6K
View

Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.

1.5K 454.3K
View
azure-kubernetes logo
DevOps & CI/CD

azure-kubernetes

Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.

1.5K 447.1K
View

Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.

92.7K 354.9K
View
just-scrape logo
DevOps & CI/CD

just-scrape

Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.

69 245K
View

Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.

462 159.7K
View

Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.

462 159.1K
View
deploy-to-vercel logo
DevOps & CI/CD

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

31.9K 146.6K
View
programmatic-seo logo
DevOps & CI/CD

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
I
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View