Giter Site home page Giter Site logo

elfsquad / configurator Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 57 KB

The @elfsquad/configurator package is a wrapper around the Elfsquad configurator API

Home Page: https://docs.elfsquad.io/docs/configurator/libraries/elfsquad-configurator-library

License: MIT License

JavaScript 1.64% TypeScript 98.36%
configurator cpq elfsquad

configurator's Introduction

Elfsquad Configurator Library

The Elfsquad Configurator Library allows you to easily interact with the Configurator API.

Documentation

Documentation can be found on https://docs.elfsquad.io/docs/configurator/libraries/elfsquad-configurator-library

Examples

const TENANT_ID = 'ff0a9727-ced1-4b99-9f8a-2087a1f79ba4';

const configuratorContext = new ConfiguratorContext({
    tenantId: TENANT_ID
});

configuratorContext.getSettings().then((settings) => {
    console.log('settings', settings);
});

configuratorContext.getConfigurationModels().then((models) => {
    console.log('models', models);

    let model = models.features[0];
    
    configuratorContext.newConfiguration(model.name).then((configuration) => {
        console.log('newConfiguration', configuration);

        configuratorContext.openConfiguration(configuration.id).then((configuration) => {
            console.log('openedConfiguration', configuration);

            const feature = configuration.steps[0].features[0];
            
            configuration.updateRequirement(feature.id, true, 1).then((updateResult) => {
                console.log('updateResult', updateResult);
            });

            configuration.updateText(feature.id, 'test 123').then((updateResult) => {
                console.log('updateTextResult', updateResult);
            });

            configuration.changeLanguage(Object.keys(models.languages)[2]).then((updateResult) => {
                console.log('changeLanguage', updateResult);
            });

            configuration.getStepImage(configuration.steps[0].id).then((image) => {
                console.log('image', image);
            });

            configuration.getPdf().then((pdf) => {
                console.log('pdf', pdf);
            });

            configuratorContext.getLayout3d().then((layout) => {
                console.log('layout', layout);
            });
        });
    });
});

configurator's People

Contributors

jasperoosthoek avatar johannesheesterman avatar stanvanrooy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jasperoosthoek

configurator's Issues

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.