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

omx-sdk

v1.0.7

Published

Complete SDK for Oxinion Marketing Exchange

Downloads

37

Readme

OMX SDK

npm version License: MIT

The official JavaScript/TypeScript SDK for Oxinion Marketing Exchange (OMX) - a powerful platform for location-based marketing automation with multi-channel campaign management.

✨ Features

  • 🌍 Geotrigger Management - Create location-based triggers with precision
  • 📧 Email Campaigns - Send personalized email campaigns
  • 🔔 Push Notifications - Real-time mobile push notifications
  • 📡 Beacon Integration - Bluetooth beacon proximity detection
  • 🔗 Webhook Support - Custom webhook integrations
  • 🎯 Campaign Orchestration - Visual workflow automation
  • 🔐 Secure Authentication - Built-in API key management
  • 📘 TypeScript Support - Full type safety and IntelliSense

🚀 Quick Start

Installation

npm install omx-sdk

Basic Usage

import { createOmxClient } from 'omx-sdk';

// Initialize the OMX client with all managers
const omx = createOmxClient({
  clientId: process.env.OMX_CLIENT_ID,
  secretKey: process.env.OMX_SECRET_KEY
});

// Create a geotrigger
const geoTrigger = await omx.geotrigger.create({
  name: "Coffee Shop Welcome",
  location: { 
    lat: 40.7128, 
    lng: -74.0060 
  },
  radius: 50, // meters
  actions: {
    onEnter: {
      notification: {
        title: "Welcome!",
        body: "Get 20% off your first order!"
      }
    }
  }
});

console.log('Geotrigger created:', geoTrigger.id);

Modular Imports

Import only what you need:

// Main client with all managers (recommended)
import { createOmxClient } from 'omx-sdk';
const omx = createOmxClient({ clientId: '...', secretKey: '...' });

// Individual managers (for custom setups)
import { GeoTriggerManager } from 'omx-sdk/geotrigger';
import { EmailManager } from 'omx-sdk/email';
import { NotificationManager } from 'omx-sdk/notification';

📖 API Reference

Core SDK

import { createOmxClient, OMXClient } from 'omx-sdk';

const omx = createOmxClient({
  clientId: 'your-client-id',
  secretKey: 'your-secret-key'
});

// Access all managers
omx.geotrigger   // GeoTrigger management
omx.email        // Email campaigns  
omx.notification // Push notifications
omx.webhook      // Webhook management
omx.beacon       // Beacon integration
omx.campaign     // Campaign orchestration
omx.core         // Low-level HTTP client

Geotrigger Management

// Create geotrigger
const trigger = await omx.geotrigger.create({
  name: "Store Entrance",
  location: { lat: 40.7128, lng: -74.0060 },
  radius: 100,
  actions: {
    onEnter: { /* ... */ },
    onExit: { /* ... */ }
  }
});

// List geotriggers
const triggers = await omx.geotrigger.list({
  limit: 10,
  offset: 0
});

// Update geotrigger
await omx.geotrigger.update(trigger.id, {
  name: "Updated Store Entrance",
  radius: 150
});

// Delete geotrigger  
await omx.geotrigger.delete(trigger.id);

Email Campaigns

// Send email campaign
const campaign = await omx.email.send({
  to: ['[email protected]'],
  subject: 'Welcome to our store!',
  template: 'welcome-template',
  data: {
    firstName: 'John',
    discount: '20%'
  }
});

// Track email status
const status = await omx.email.getStatus(campaign.id);

Push Notifications

// Send push notification
const notification = await omx.notification.send({
  tokens: ['device-token-1', 'device-token-2'],
  title: 'Special Offer!',
  body: 'Limited time: 50% off everything!',
  data: {
    category: 'promotion',
    deepLink: '/offers'
  }
});

Webhook Integration

// Create webhook
const webhook = await omx.webhook.create({
  url: 'https://your-app.com/webhooks/omx',
  events: ['geotrigger.entered', 'campaign.completed'],
  secret: 'your-webhook-secret'
});

Campaign Management

// Create campaign workflow
const campaign = await omx.campaign.create({
  name: 'Welcome Series',
  trigger: {
    type: 'geotrigger',
    geotriggerId: trigger.id
  },
  actions: [
    {
      type: 'notification',
      delay: 0,
      config: {
        title: 'Welcome!',
        body: 'Thanks for visiting!'
      }
    },
    {
      type: 'email',  
      delay: 3600, // 1 hour later
      config: {
        template: 'follow-up',
        subject: 'We hope you enjoyed your visit'
      }
    }
  ]
});

🔧 Configuration

Environment Variables

# Required
OMX_CLIENT_ID=your-client-id
OMX_SECRET_KEY=your-secret-key

# Optional
OMX_BASE_URL=https://api.omx.oxinion.com
OMX_ENVIRONMENT=production

SDK Configuration

const omx = createOmxClient({
  clientId: process.env.OMX_CLIENT_ID,
  secretKey: process.env.OMX_SECRET_KEY,
  
  // Optional configurations
  baseUrl: 'https://api.omx.oxinion.com',
  timeout: 30000, // Request timeout in ms
  retries: 3,     // Number of retries for failed requests
  
  // Custom headers
  headers: {
    'X-Custom-Header': 'value'
  }
});

🧪 Error Handling

import { OMXError, OMXValidationError, OMXAuthError } from 'omx-sdk';

try {
  const result = await omx.geotrigger.create(invalidData);
} catch (error) {
  if (error instanceof OMXValidationError) {
    console.log('Validation failed:', error.details);
  } else if (error instanceof OMXAuthError) {
    console.log('Authentication failed:', error.message);
  } else if (error instanceof OMXError) {
    console.log('OMX API error:', error.message, error.code);
  } else {
    console.log('Unexpected error:', error);
  }
}

📝 TypeScript Support

The SDK is written in TypeScript and provides full type definitions:

import { 
  OMXClient, 
  GeoTrigger, 
  EmailCampaign, 
  NotificationResult,
  CreateGeoTriggerRequest 
} from 'omx-sdk';

const omx: OMXClient = createOmxClient({ /* ... */ });

const request: CreateGeoTriggerRequest = {
  name: "Typed Geotrigger",
  location: { lat: 40.7128, lng: -74.0060 },
  radius: 100
};

const trigger: GeoTrigger = await omx.geotrigger.create(request);

🔗 Links

📄 License

MIT License - see LICENSE file for details.

🤝 Support