Getting StartedQuickstart
SDK Quickstart
Get SilentAuth integrated in under 5 minutes.
Installation
Install the SilentAuth SDK for your platform:
JavaScript / TypeScript
npm install @silentauth/sdk
Python
pip install silentauth
Go
go get github.com/silentauth/silentauth-go
PHP
composer require silentauth/silentauth-php
Create an Intent
When your agent or pipeline needs to perform a sensitive action, declare an intent:
import { SilentAuth } from '@silentauth/sdk';
const sa = new SilentAuth({
projectId: process.env.SA_PROJECT_ID,
secretKey: process.env.SA_SECRET_KEY,
});
// Declare what the agent wants to do
const intent = await sa.createIntent({
action: 'deploy_production',
params: { env: 'prod', version: '2.1.0' },
approvers: ['ops-team'],
expiresIn: 3600, // 1 hour
});
console.log('Approval URL:', intent.approvalUrl);
// Human approver clicks this link to review and approveWait for Approval & Execute
Wait for human approval, then execute with the permit:
// Option 1: Poll for approval
const permit = await intent.waitForApproval({ timeout: 300000 });
// Option 2: Use webhooks (recommended)
// Configure webhook URL in dashboard to receive approval events
if (permit.status === 'approved') {
// Execute the action with the permit token
await deployToProduction({
version: '2.1.0',
permitToken: permit.token,
});
}
// On your backend, validate the permit before executing
const validation = sa.validatePermit(permit.token);
if (!validation.valid) {
throw new Error('Invalid permit');
}GitHub Actions Integration
# .github/workflows/deploy.yml
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: silentauth/require-approval@v1
with:
project-id: ${{ secrets.SA_PROJECT_ID }}
secret-key: ${{ secrets.SA_SECRET_KEY }}
action: deploy_production
approvers: ops-team
timeout: 30m
- name: Deploy to Production
run: ./deploy.sh
# Only runs after human approval