Coder Social home page Coder Social logo

trakto-sdk-sample's Introduction

Summary

  1. About this repository
  2. What is Trakto ?
  3. What is Trakto SDK®?
  4. How can this project be useful for you?
  5. How to use ?
  6. Running on localhost
  7. Links

1. About this repository

This repository is an example of a site using the Trakto Button®, via Trakto® SDK, for creating banners, social posts, ebooks, etc.

2. What is Trakto ?

Trakto is a platform for creating marketing materials, sales and print.

With Trakto you can create professional designs without having experience with complex platforms, for example Photoshop and Illustrator.

See more on: https://trakto.design

3. What is Trakto SDK® ?

Trakto SDK® is a development package utilizing all the resources for creating digital marketing materials, print, sales, etc. It's way to integrate the our editor in your site.

The development packages includes:

  1. Trakto Button®: Integrate the our editor in your site or plataform.
  2. Trakto API®: Creation and management of documents created with Trakto via Restful API.

4. How can this project be useful for you ?

This project presents a simple way with lean approach on how to integrate the button to your website and/or platform.

5. How to use ?

The project of this repository already provides information and credncial usage that can be used as an example. If you want to customize with your credentials:

  1. Identify your API Secret, Product Key and Email

Initialize the sdk and starting the editor via Button

 <script>
    window.onload = () => {
        (function() {
            TraktoEditor.init({
                apiSecret: '<Your Api Key>',
                productKey: '<Your Product Key>',
                userEmail: '[email protected]',
                buttonClassName: 'trakto-button', 
                customLoaderImageUrl: '<Loader image URL>',
                customLoaderColor: '<Hexadecimal Loader color>',
                customLoaderBgColor: '<Hexadecimal Background Loader Color>',
                defaultCallback: data => {  },
                listFormatsCallback: (data) => { },
                listTemplatesCallback: (data) => { },
                listDocumentsCallback: (data) => { }
            });
        })();
    };
</script>

Initialize the sdk and starting the editor via JS

 <script>
    window.onload = () => {
        (function() {
            TraktoEditor.init({
                apiSecret: '<Your Api Key>',
                productKey: '<Your Product Key>',
                userEmail: '[email protected]',
                customLoaderImageUrl: '<Loader image URL>',
                customLoaderColor: '<Hexadecimal Loader color>',
                customLoaderBgColor: '<Hexadecimal Background Loader Color>',
                onAuthenticated: traktoEditor => {
                    if (traktoEditor) {
                        traktoEditor.openDocument('<Document ID>', data => console.log('closed editor'));
                        traktoEditor.openFromTemplate('<Template ID>', data => console.log('closed editor'));
                        traktoEditor.openFromFormat('<Format ID>', data => console.log('closed editor'));
                    }
                },
                defaultCallback: data => {  },
                listFormatsCallback: (data) => { },
                listTemplatesCallback: (data) => { },
                listDocumentsCallback: (data) => { }
            });
        })();
    };
</script>
  1. Make the button available to initialize the editor

2.1 Initializing via button

Create from empty page:

   <button class="<Your Button Class Name>" data-formatid="<Your Format Id>"> 
        Your button title 
   </button>

Create from template:

   <button class="<Your Button Class Name>" data-templateid="<Your Format Id>"> 
        Your button title 
   </button>

Continue editing a previously created document:

   <button class="<Your Button Class Name>" data-documentid="<Your Format Id>"> 
        Your button title 
   </button>

2.2 Initializing via JS Function

Function Description
openDocument Opens the document previously created by user
openFromTemplate Creates the document from a template
openFromFormat Creates the document from a pages format

trakto-sdk-sample's People

Contributors

jorgehsrocha avatar

Stargazers

Wesley Egberto avatar

Watchers

Odair Seixas avatar James Cloos avatar  avatar Danilo Rodrigues avatar Renato Neto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.