
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@axeptio/provisioning
Advanced tools
Axeptio provisioning client with state management and batch operations
TypeScript toolkit for automated provisioning of Axeptio entities. It provides a typed HTTP client, composable provisioners, checkpointed execution, and a CLI — optimized for both humans and AI agents.
npm install @axeptio/provisioning
import {
createClient,
createExecutor,
OrganizationProvisioner,
ProjectProvisioner,
CookieConfigurationProvisioner,
TermsConfigurationProvisioner,
ProvisioningCallbacks,
} from '@axeptio/provisioning';
const client = createClient({ apiKey: 'your-api-key', environment: 'staging' });
const executor = createExecutor(client, 'my-migration-2024');
const org = new OrganizationProvisioner('org', {
companyName: 'Example Corp',
email: 'contact@example.com',
country: 'FR', line1: '123 Rue de la Paix', city: 'Paris', postalCode: '75001',
isProfessional: 'YES',
});
const project = new ProjectProvisioner('project', {
name: 'Example Website', websiteURL: 'https://example.com', locales: ['en', 'fr'],
});
const cookies = new CookieConfigurationProvisioner('cookies', {
projectId: '', language: 'en', country: 'FR',
steps: [{ layout: 'welcome', title: 'We use cookies' }],
});
const terms = new TermsConfigurationProvisioner('terms', {
projectId: '',
config: { language: 'en', title: 'Terms of Service', name: 'tos', mandatory_download: false },
content: {
sections: [
{ uid: 'intro', name: 'introduction', title: 'Introduction', blocks: [
{ type: 'title', content: 'Introduction' },
{ type: 'richText', content: 'Welcome to our service.' },
] }]
},
});
project
.addConfiguration(cookies)
.addConfiguration(terms)
.onSuccess(ProvisioningCallbacks.publishProject(['cookies']))
.onSuccess(ProvisioningCallbacks.startScan({ maxPages: 10 }));
org.addProject(project);
executor.addOrganization(org);
await executor.execute({ mode: 'dryrun', organizationBatchSize: 1, projectBatchSize: 2, autoCheckpoint: true });
Add callbacks to execute actions after successful or failed provisioning:
import { ProvisioningCallbacks } from '@axeptio/provisioning';
// Single callback
project.onSuccess(ProvisioningCallbacks.publishProject(['cookies', 'tcf']));
// Multiple callbacks
project
.onSuccess(ProvisioningCallbacks.publishProject())
.onSuccess(ProvisioningCallbacks.startScan({
maxTabs: 3,
maxPages: 10,
testCMP: true,
languages: ['en', 'fr']
}))
.onFailure(ProvisioningCallbacks.logFailure('Project creation failed'));
// Custom callbacks
project.onSuccess(async (result: Project, context) => {
console.log(`Project created: ${result.name} (${result._id})`);
await sendNotificationEmail(result.name);
await updateExternalSystem(result._id);
});
// Chain multiple callbacks
project.onSuccess(ProvisioningCallbacks.chain(
ProvisioningCallbacks.publishProject(['cookies']),
ProvisioningCallbacks.logSuccess('Project published'),
customNotificationCallback
));
Callback | Description | Parameters |
---|---|---|
publishProject(services?) | Publish project configurations | services: string[] - Default: ['cookies', 'tcf'] |
startScan(config) | Launch automator scan job | maxTabs , maxPages , testCMP , languages |
logSuccess(message?) | Log successful completion | message: string - Optional custom message |
logFailure(message?) | Log failure details | message: string - Optional custom message |
chain(...callbacks) | Execute multiple callbacks in sequence | callbacks: ProvisioningCallback[] |
Note: Callbacks are preserved during state recovery. When resuming from a saved state, callbacks will still execute for newly completed nodes, but not for previously completed ones.
Projects groups are organizational folders used in the backoffice to organize projects. They execute after projects are created so their projectIds
array can be populated.
// Create projects first
const project1 = new ProjectProvisioner('proj-1', projectData1);
const project2 = new ProjectProvisioner('proj-2', projectData2);
// Create a projects group and add projects to it
const projectsGroup = new ProjectsGroupProvisioner('group-1', {
name: 'Website Projects',
organizationId: 'org-123' // Optional - will be set from context
})
.addProject(project1) // Projects will be referenced by ID
.addProject(project2)
.onSuccess(ProvisioningCallbacks.logSuccess('Projects group created'));
// Add to executor
org.addProject(project1);
org.addProject(project2);
executor.addOrganization(org);
executor.addProjectsGroup(projectsGroup); // Executed after projects
Execution Order: Projects Groups are executed after Projects to ensure project IDs are available for the projectIds
array.
Small, focused snippets to reduce context load. Replace IDs/emails as needed.
const org = new OrganizationProvisioner('org', { companyName: 'ACME', email: 'billing@acme.com', country: 'FR', line1: '1 Rue', city: 'Paris', postalCode: '75001', isProfessional: 'YES' });
const project = new ProjectProvisioner('proj', { name: 'Website', websiteURL: 'https://acme.com' });
org.addProject(project);
executor.addOrganization(org);
const group = new ProjectsGroupProvisioner('group', { name: 'Web Properties' }).addProject(project);
executor.addProjectsGroup(group);
const cookies = new CookieConfigurationProvisioner('cookies', {
projectId: '', language: 'en', country: 'FR',
steps: [{ layout: 'welcome', title: 'We use cookies' }],
});
project.addConfiguration(cookies);
Optionally let the provisioner build steps from a list of vendor solution IDs. Vendors are assigned to their most frequent category, cookie-step templates are used to shape steps, and an optional ConsentWall can be added as a special step.
const autoCookies = new CookieConfigurationProvisioner('cookies-auto', {
projectId: '',
language: 'en',
autoCategorize: {
vendorIds: ['64a...','64b...'],
language: 'en',
withConsentWall: true,
},
});
project.addConfiguration(autoCookies);
Notes:
specialSteps
for the ConsentWall./vendors/categories
, /vendors/solutions/{id}/{language}
, and /templates/cookie-step
endpoints.Provision project theming with a simple style guide. We expose types and a helper to mirror WidgetGenerator
behavior without pulling its internals.
Types:
StyleGuideInput
— { lightColor, darkColor, themeColor, isDarkMode?, isMonochrome?, font? } (hex colors without '#')ProjectStylesheet
— shape compatible with ProjectInput
(colors
, fonts
, widgetStyle
, overlayStyle
, isCustomStyle
)Helper:
integrateStyleGuide(style: StyleGuideInput): ProjectStylesheet
Example:
import { ProjectProvisioner, integrateStyleGuide, type StyleGuideInput } from '@axeptio/provisioning';
const sg: StyleGuideInput = {
lightColor: 'F5BD55',
darkColor: '000000',
themeColor: 'f6c434',
isDarkMode: false,
isMonochrome: false,
font: 'Lato',
};
const stylesheet = integrateStyleGuide(sg);
const project = new ProjectProvisioner('project-1', {
name: 'Website',
websiteURL: 'https://example.com',
...stylesheet,
});
Notes:
ProjectInput.colors
, widgetStyle
, and overlayStyle
support extended fields (e.g., toggle_on
, consent_button_*
, borderRadius
, position.side
).isCustomStyle: true
is set by the helper to indicate custom design.const terms = new TermsConfigurationProvisioner('terms', {
projectId: '',
config: { language: 'en', title: 'Terms of Service', name: 'tos' },
content: { sections: [{ uid: 'intro', name: 'introduction', blocks: [ { type: 'title', content: 'Introduction' }, { type: 'richText', content: 'Welcome.' } ] }] }
});
project.addConfiguration(terms);
const company = new VendorCompanyProvisioner('vendor-co', { name: 'Acme Analytics', domain: 'acme-analytics.example' });
const solution = new VendorSolutionProvisioner('vendor-sol', {
name: 'acme-analytics',
title: { __lang: { en: 'Acme Analytics' } },
website: { __lang: { en: 'https://acme.example' } },
shortDescription: { __lang: { en: 'Analytics' } },
categoryIds: [],
} as any);
executor.addVendorCompany(company);
executor.addVendorSolution(solution);
// 1) Customer
const customer = await client.createCustomer({
email: 'billing@example.com', name: 'Example Corp',
tax_exempt: 'none', preferred_locales: ['fr-FR','en-US'],
address: { line1: '123 Rue', city: 'Paris', country: 'FR', postal_code: '75001' },
metadata: { isProfessional: 'YES', vatNumber: 'FR123...', contactName: 'Jane' },
expand: ['tax_ids','invoice_settings.default_payment_method','sources'],
});
// 2) VAT
await client.createCustomerTaxId(customer.id, { type: 'eu_vat', value: 'FR123...' });
// 3) Subscription
project.setSubscription(new SubscriptionProvisioner('sub', {
customer: customer.id,
items: [{ price: 'price_agency_monthly', quantity: 1 }],
payment_behavior: 'default_incomplete', currency: 'eur',
expand: ['latest_invoice','discounts','items.price'],
metadata: { organizationId: '...', userId: '...' },
}));
const user = new UserProvisioner('user', { email: 'new@acme.com', password: 'Secret123!', displayName: 'New User', data: { preferredLanguage: 'en', acceptTerms: true }});
user.addInvitation(new InvitationProvisioner('inv', { email: 'new@acme.com', data: { collection: 'organizations', id: 'orgId' }}));
executor.addUser(user);
executor.addGroupAssignment(new GroupManagerProvisioner('assign', { userId: '', projectId: 'projectId', action: 'add' }));
Provision users and manage their access to organizations and projects:
import {
UserProvisioner,
InvitationProvisioner,
GroupManagerProvisioner
} from '@axeptio/provisioning';
// Create user with invitations
const user = new UserProvisioner('user-1', {
email: 'newuser@example.com',
password: 'SecurePassword123',
displayName: 'New User',
data: {
preferredLanguage: 'en',
acceptTerms: true
}
})
.onSuccess(ProvisioningCallbacks.logSuccess('User created successfully'))
.onSuccess(ProvisioningCallbacks.addUserToOrganization('org-id'));
// Add invitation to organization
const invitation = new InvitationProvisioner('invite-1', {
email: 'newuser@example.com',
data: {
collection: 'organizations',
id: 'org-id-123',
templateVars: {
organization: { companyName: 'Example Corp' }
}
}
});
user.addInvitation(invitation);
// Manage group assignments
const groupAssignment = new GroupManagerProvisioner('group-1', {
userId: 'user-id-from-context',
projectId: 'project-id-123',
action: 'add'
});
executor.addUser(user);
executor.addGroupAssignment(groupAssignment);
Callback | Description | Usage |
---|---|---|
addUserToOrganization(orgId) | Add user to organization | After user creation |
addUserToProject(projectId) | Add user to project | After user creation |
logSuccess(message?) | Log successful completion | After successful user creation |
# Set admin credentials
export AXEPTIO_ADMIN_USERNAME="your-admin-username@axept.io"
export AXEPTIO_ADMIN_PASSWORD="your-admin-password"
# Run provisioning
axeptio-provision run my-migration config.json --admin-username $AXEPTIO_ADMIN_USERNAME --admin-password $AXEPTIO_ADMIN_PASSWORD
# Check status
axeptio-provision status --admin-username $AXEPTIO_ADMIN_USERNAME --admin-password $AXEPTIO_ADMIN_PASSWORD
# Resume after interruption
axeptio-provision resume my-migration --admin-username $AXEPTIO_ADMIN_USERNAME --admin-password $AXEPTIO_ADMIN_PASSWORD
# View checkpoints
axeptio-provision checkpoints my-migration --admin-username $AXEPTIO_ADMIN_USERNAME --admin-password $AXEPTIO_ADMIN_PASSWORD
# Rollback created entities
axeptio-provision rollback my-migration --admin-username $AXEPTIO_ADMIN_USERNAME --admin-password $AXEPTIO_ADMIN_PASSWORD
# Clean up state
axeptio-provision clean my-migration --admin-username $AXEPTIO_ADMIN_USERNAME --admin-password $AXEPTIO_ADMIN_PASSWORD
Create a config.json
file for execution settings:
{
"mode": "dryrun",
"organizationBatchSize": 3,
"projectBatchSize": 5,
"configurationBatchSize": 10,
"autoCheckpoint": true,
"checkpointInterval": 300,
"continueOnError": false,
"maxRetries": 3,
"retryDelay": 1000
}
The package automatically handles:
// Resume from last saved state
const executor = await ResumableProvisioningExecutor.fromState(
'my-migration-2024',
'./provisioning-state',
client
);
await executor.execute(config);
// Rollback all created entities in reverse order
await executor.rollback();
State is automatically persisted to disk:
./provisioning-state/
├── my-migration-2024.json # Main state file
└── checkpoints/
└── my-migration-2024/
├── 2024-01-15T10-30-00-execution-start.json
└── 2024-01-15T10-45-00-organizations-completed.json
The client automatically handles Axeptio's rate limits:
AXEPTIO_ADMIN_USERNAME=your-admin-username@axept.io
AXEPTIO_ADMIN_PASSWORD=your-admin-password
AXEPTIO_ENVIRONMENT=staging # or production
Command | Description |
---|---|
run <state-id> <config-file> | Start new provisioning |
resume <state-id> | Resume interrupted provisioning |
status | Show all provisioning states |
checkpoints <state-id> | List available checkpoints |
rollback <state-id> | Delete all created entities |
clean <state-id> | Remove state files |
interface ClientConfig {
apiKey: string;
baseURL?: string;
environment?: 'staging' | 'production';
maxRetries?: number;
retryDelay?: number;
rateLimitRpm?: number;
}
New helper endpoints exposed by the client for bulk cookie configuration generation:
Templates & Steps
getCookieStepTemplates()
— list available cookie-step templatesgetCookieStepTemplateByName(name)
— fetch a specific cookie-step templategetCustomCookieTemplate({ language, country?, subdivision?, steps })
— generate a cookie template from step namesVendors & Categories
getVendorCategories(params?)
getVendorSolutionLocalized(id, language)
Project Admin Actions
lockProject(projectId)
/ unlockProject(projectId)
unpublishProject(projectId)
duplicateProject(projectId, { name?, websiteURL? })
Cookies
buildCookieConfiguration(client, { projectId, language, stepNames?, stepsOverride?, published?, googleConsentMode? })
positionStepByNameAndIndex(steps, name, index)
/ concatenateOtherSteps(steps)
Design
integrateStyleGuide(style: StyleGuideInput): ProjectStylesheet
interface ExecutionConfig {
mode: 'dryrun' | 'staging' | 'production';
organizationBatchSize?: number;
projectBatchSize?: number;
configurationBatchSize?: number;
autoCheckpoint?: boolean;
checkpointInterval?: number;
continueOnError?: boolean;
maxRetries?: number;
retryDelay?: number;
}
See the examples/
directory for complete usage:
basic-usage.ts
— Org, Project, Cookies, Terms, optional Subscriptionorganizations-and-projects.ts
— Multiple projects + projects groupcookies-config.ts
— Cookie configuration with steps/vendorsterms-config.ts
— ContractsV2 Terms with config/content modelvendors.ts
— Vendor company and solution creationbilling.ts
— Stripe customer + VAT + subscriptionusers-and-access.ts
— Users, invitations, and project accessconfig.json
— Execution configuration© Axeptio 2025 - Proprietary
FAQs
Axeptio provisioning client with state management and batch operations
We found that @axeptio/provisioning demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.