
Security News
Frontier AI Is Now Critical Infrastructure
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.
@moritzmyrz/tripletex.js
Advanced tools
TypeScript SDK for the Tripletex API.
Default API base URL: https://tripletex.no/v2 (prod)
npm install @moritzmyrz/tripletex.js
import TripletexClient from '@moritzmyrz/tripletex.js';
const client = new TripletexClient();
const session = await client.createSessionToken({
consumerToken: process.env.TRIPLETEX_CONSUMER_TOKEN!,
employeeToken: process.env.TRIPLETEX_EMPLOYEE_TOKEN!,
});
client.useSessionToken(session.token, 0);
const customers = await client.Customer_search({
query: { from: 0, count: 100, fields: 'id,name' },
});
Use test environment by setting environment: 'test':
const client = new TripletexClient({
environment: 'test',
});
TypeScript infers request and response types per operation directly from the OpenAPI spec:
const company = await client.Company_get({
path: { id: 123 },
query: { fields: 'id,name' },
});
// company is typed as ResponseWrapperCompany
import TripletexClient from '@moritzmyrz/tripletex.js';
const client = new TripletexClient({
sessionToken: process.env.TRIPLETEX_SESSION_TOKEN!,
companyId: 0,
});
// 1) Get one by id (required path params are enforced)
const activity = await client.Activity_get({
path: { id: 123 },
});
// 2) Search/list (query keys are operation-specific)
const customers = await client.Customer_search({
query: {
from: 0,
count: 100,
fields: 'id,name',
isInactive: false,
},
});
// 3) Create/update (required body is enforced)
await client.Company_put({
body: {
id: 1,
},
});
// 4) Access transport metadata when needed
const withMeta = await client.Country_searchWithMeta({
query: { count: 10 },
});
console.log(withMeta.meta.requestId);
For query arrays, repeat the same query key by passing an array value:
await client.Contact_search({
query: {
id: ['1', '2', '3'],
},
});
Tripletex expects Basic auth where username is companyId (or 0) and password is sessionToken.
This client handles that for you after useSessionToken() or createSessionToken().
The recommended session-token endpoint is used:
POST /token/session/:createList endpoints usually accept:
fromcountsortingfieldsThe API often wraps payloads in value or values. The generated endpoint methods return the raw payload from Tripletex so you can inspect all envelope fields, including paging metadata.
Tripletex returns:
X-Rate-Limit-LimitX-Rate-Limit-RemainingX-Rate-Limit-ResetFor 429 responses, the base transport retries automatically up to maxRateLimitRetries (default 1) using X-Rate-Limit-Reset as delay guidance.
Every *WithMeta method returns:
data)meta) including:
requestId (x-tlx-request-id)All OpenAPI operations from the OpenAPI specs are generated into typed method signatures and grouped into resource mixins:
path, query, and body argument typesRegenerate from production spec:
npm run generate:resources
Regenerate from test spec:
npm run generate:resources:test
npm install
npm run generate:resources
npm run check
npm run build
FAQs
TypeScript SDK for the Tripletex API
We found that @moritzmyrz/tripletex.js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.