npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tolinax/ayoune

v2025.9.13

Published

aYOUne - Business as a Service

Readme

aYOUne Node.js SDK

This SDK provides a comprehensive TypeScript interface for the aYOUne Business as a Service Platform by tolinax. Build powerful integrations with over 600 data models and 4500+ endpoints for CRM, ERP, PIM, marketing automation, and more.

If you're not already a customer, get your account here.

Features

  • Complete Business Suite: CRM, ERP, PIM, marketing automation, affiliate networks
  • Type-Safe: Full TypeScript support with comprehensive type definitions
  • Fluent API: Chainable query methods for intuitive data manipulation
  • Multiple Formats: Support for JSON, XML, YAML, CSV response formats
  • Pagination: Built-in pagination handling with automatic link following
  • Rate Limiting: Automatic rate limit monitoring and handling

Installation

npm install @tolinax/ayoune

Authentication

  1. Get your API token from your aYOUne dashboard
  2. Configure authentication:
    • Set environment variable: AYOUNE_TOKEN=your_token_here
    • Or pass directly to constructor: new aYOUne(yourToken)

Quick Start

import { aYOUne } from "@tolinax/ayoune";

const ayoune = new aYOUne(); // Uses AYOUNE_TOKEN env var
// or
const ayoune = new aYOUne("your_token_here");

(async () => {
  try {
    // Get consumers using module-based approach
    const response = await ayoune.crm.consumers.list().exec();
    
    console.log('Consumers:', response.payload());
    console.log('Rate limit:', response.rateLimit());
    
    // Get next page if available
    if (response.links().find(link => link.rel === "next")) {
      const nextPage = await response.next();
      console.log('Next page:', nextPage.payload());
    }
  } catch (error) {
    console.error('API Error:', error);
  }
})();

Fluent API Usage

The SDK provides a fluent interface with chainable methods:

// Basic list request
const consumers = await ayoune.crm.consumers.list().exec();

// With response formatting
const yamlData = await ayoune.crm.consumers.list().yaml().exec();
const csvData = await ayoune.crm.consumers.list().csv(',', '').exec();

// With query modifiers
const slicedData = await ayoune.crm.consumers.list()
  .slice(10)           // Limit to 10 results
  .lean()              // Hide metadata
  .verbosity('minimal') // Minimal response
  .exec();

// Debug mode
const debugData = await ayoune.crm.consumers.list().debug().exec();

Available Query Methods

  • .lean() - Remove metadata from response
  • .yaml() - Get response in YAML format
  • .xml() - Get response in XML format
  • .csv(delimiter, emptyValue) - Get response in CSV format
  • .table() - Get response in table format
  • .slice(n) - Limit results to n items
  • .verbosity('default' | 'extended' | 'minimal') - Control response detail
  • .debug() - Enable debug mode
  • .describe() - Get API endpoint description
  • .exec() - Execute the request

Method-Based Access

The SDK also supports direct method-based access for those who prefer a more traditional API approach:

// Create a new consumer
const leadData = {
  first_name: "John",
  last_name: "Doe",  
  email: "[email protected]",
  type: "lead"
};
const newConsumer = await ayoune.create('consumers', leadData).exec();

// Get all consumers
const allConsumers = await ayoune.list('consumers').exec();

// Get a specific consumer by ID
const consumer = await ayoune.get('consumers', '123').exec();

// Update a consumer
const updatedData = { first_name: "Jane" };
const updatedConsumer = await ayoune.update('consumers', '123', updatedData).exec();

// Delete a consumer
await ayoune.delete('consumers', '123').exec();

// Method-based access also supports fluent API
const filteredConsumers = await ayoune.list('consumers')
  .slice(5)
  .yaml()
  .lean()
  .exec();

Available Method-Based Operations

  • ayoune.list(resource) - Get multiple records
  • ayoune.get(resource, id?) - Get single record by ID (or all if no ID)
  • ayoune.create(resource, data) - Create new record
  • ayoune.update(resource, id, data) - Update existing record
  • ayoune.delete(resource, id) - Delete record

All method-based operations support the same fluent API helpers as module-based access.

Response Handling

All API calls return an aYOUneApiResponseWrapper with helper methods:

const response = await ayoune.crm.consumers.list().exec();

// Get the actual data
const data = response.payload();

// Check rate limiting
const rateLimit = response.rateLimit();
console.log(`${rateLimit.remaining}/${rateLimit.limit} requests remaining`);

// Access pagination links
const links = response.links();

// Automatically get next page
if (response.links().find(link => link.rel === "next")) {
  const nextPage = await response.next();
}

API Access Patterns

The SDK supports two approaches for accessing the aYOUne API:

1. Module-Based Access (Domain Organization)

// Resources are organized by business domain
await ayoune.crm.consumers.list().exec();
await ayoune.sales.products.get('123').exec();
await ayoune.marketing.campaigns.list().exec();

Available modules include:

  • ayoune.crm.* - Customer relationship management
  • ayoune.sales.* - Sales operations
  • ayoune.products.* - Product information management
  • And many more based on your aYOUne configuration

2. Method-Based Access (Direct Resource Access)

// Direct access to any resource by name
await ayoune.list('consumers').exec();
await ayoune.get('products', '123').exec();
await ayoune.create('campaigns', campaignData).exec();

Both approaches support the same fluent API helpers and return the same response wrapper.

Development

Building

npm run build        # Compile TypeScript
npm run prebuild     # Clean dist directory
npm run postbuild    # Copy package.json

Testing

npm test            # Run tests (builds first)

Environment Setup

Create a .env file:

AYOUNE_TOKEN=your_token_here

API Documentation

For complete endpoint documentation, visit openapi.ayoune.app.

Support

License

Apache-2.0


Made with ❤️ at Tegernsee by tolinax