Components

Create div elements where NeoDay will mount its components.

<div id="campaign-list"></div>
<div id="customer-card"></div>
<script src="https://js.neoday.com/v1/neoday.min.js"></script>

Initialize Neoday SDK

<script>
let neo = new neoday.NeoDay({
    base_url: 'https://gateway.test.client-designated-gateway.neo.day',
    locale: 'nl_NL',
    auth: {
        endpoint: '/api/auth',
        x_site_token: '',
        client_id: '',
        headers: {},
        params: {}
    }
});
</script>

Campaign list - Deprecated

Load the campaign list with the following code snippet just below the initialization of the neoday SDK.

neo.CampaignList('campaign-list')

Campaign widget - Deprecated use Campaign Page instead

This component renders a single campaign. It requires the campaign_id to be set to the ID of the campaign you want to render.

neo.CampaignWidget(
  'campaign-widget',
  {
    campaign_id: '<campaign_id>',
    background_placeholder: {
      type: 'image' /** color || image */,
      background_image: '<image_url>' /** hex code || path */ ,
      background_color: '#000000'
    },
    text_style: {
      heading: {
        color: '#ffffff'
      },
      description: {
        color: '#ffffff'
      },
      more_info: {
        color: '#ffffff'
      }
    },
    mode: 'card',
    login: {
      label: 'Log in',
      path: '/login'
    },
    register: {
      title: "Don't have an account?",
      link_label: "Register here" ,
      path: '/register'
    },
    more_info: {
      label: "More information",
    }
  }
)

Campaign Page

Render a page of a campaign made from backoffice's pagebuilder module using its slug as the first parameter and the element ID in your html where you want it tobe appended.

neo.CampaignPage('<campaign_page_slug>', '<div_element_id>')
🚧 In development