Git Product home page Git Product logo

lightning-out-demo's Introduction

Lightning-Out-Demo

Complete source code to showcase using Lightning component in node.js (External websites) by using Lightning Out. It shows how to enable CORS and SSL in Node.js with Video and complete source code.

Jitendra Zaa Blog

Click here for Youtube Video demo

Blog post explaining code

Steps to run

Step 1

Create below Lightning application in your Salesforce instance and name it as LightningOutDemo

<aura:application access="Global" extends="ltng:outApp">

<aura:dependency resource="forceChatter:feed" type="COMPONENT" />

</aura:application>

Step 2

Create Connected App in your Salesforce instance with callback URL - https://localhost:8081/ Copy consumer secret created in connected app and update clientId variable defined in OAuth.js file.

Step 3

Save https://localhost:8081 in CORS setting of Salesforce.

Step 4

Run npm install command in the directory where this code is downloaded. It will download all the required node modules. Then run npm start, it will start the server

Step 5

Navigate to https://localhost:8081/ in your browser and you would see Lightning Out in Action

lightning-out-demo's People

Contributors

jitendrazaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

lightning-out-demo's Issues

Lightningout not working after successful authentication

Lightning out component not getting loaded after authentication, Authentication is working fine. After calling

$Lightning.use(
         appName,
         function () {
           alert("ready done ");
           _lightningReady = true;
           document.getElementById("lexcontainer").style.display = "";
           if (typeof callback === "function") {
             callback();
           }
         },
         url
       );

We are getting this error

Uncaught SyntaxError: Unexpected token '<', "


<!DOCTYPE "... is not valid JSON
    at JSON.parse (<anonymous>)
    at lightning.out.delegate.js?v=1688973633677:168:43
    at xhr.onreadystatechange (lightning.out.delegate.js?v=1688973633677:137:17)
(anonymous) @ lightning.out.delegate.js?v=1688973633677:168
xhr.onreadystatechange @ lightning.out.delegate.js?v=1688973633677:137
XMLHttpRequest.send (async)
requestApp @ lightning.out.delegate.js?v=1688973633677:151
use @ lightning.out.delegate.js?v=1688973633677:165
script.onload @ lightning.out.js:46
load (async)
loadDelegateScript @ lightning.out.js:43
(anonymous) @ lightning.out.js:53
(anonymous) @ lightning.out.js:78

Pleaes help on this issue. Thanks in advance

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.