0.0.2 โ€ข Published 2 years ago

invitation-js v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Invitation JS

What is this?

Invitation is a social network focused on sharing offers & referral codes with your friends.

This library inclues all publicly available tools and SDKs available to app developpers, publishers and other players of the referral and affilaite ecosystem.

npm version

Setup ๐Ÿš€

Install the module (react, vue, es6, etc)

npm i @invitation/embed

You can import the modules you need:

import {embed, api} from 'invitation-js';

Or import everything:

import invitation from 'invitation-js';

๐Ÿ”— embeds & widgets

This module lets Invitation members (and publishers) embed offers on their own websites.

Using this module, Invitation codes members can feature their referral codes on their websites and publishers can automatically show available deals & coupons for any brands. This module is written in ES6 and is specifically written to fit in modern development stacks (React, vue, etc)

Loading the web components library

In your app, anywhere, initialize the library:

import embed from '@invitation/embed';
embed(); // Initialize web-components library

This function only need to be called once. Once in memory, the library will render all <invitation-something> components it encounters in future templates.

With a custom locale & dark theme:

import embed from '@invitation/embed';
embed({
    locale: 'es_MX',  // Spanish (Mexico) translation of widgets
    theme: 'dark',    // defaults to light theme
    partner: 'mysite' // for publishers
})

Basic setup ๐Ÿšฒ

Installing this as a module is not necessary for simple html websites like:

  • Wordpress site,
  • Basic HTML site,
  • Server-rendered web pages (PHP)
  • Wix, Squarespace
  • any other hosted services.

Simply add this script tag into your website <head>:

<script defer async src="https://invitation.codes/invitation-widgets.js" />

Usage ๐Ÿงฐ

Now, anywhere in your templates, you can include Invitation custom components. There are many widgets to choose from, and they can be customized via html attributes. Some popular ones includes:

Example:

<invitation-user-code program="buy-me-a-coffee" user="Owc4NhV2y" layout="card" ><a href="https://invitation.codes/">Find and share referral codes on Invitation</a> - the referral community.</invitation-user-code>
<!--    Invitation.codes widget
        Details: https://invt.co/widgets  -->

Documentation ๐Ÿ“–

The specifics of attributes and available tags change frequently, check the Invitation codes website for details specs:

๐Ÿงช Playground: https://invitation.codes/widgets (sign-in required)

Support

If you have questions or a bug to report, you can contact the support team directly via our inbox:

๐Ÿ’ invt.co/@support