🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

ember-cli-dfinity

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-dfinity

An add-on for using the Internet Computer in your EmberJS app.

Source
npmnpm
Version
0.3.2
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

ember-cli-dfinity

An add-on for using the Internet Computer in your EmberJS app.

Compatibility

  • Ember.js v3.24 or above
  • Ember CLI v3.24 or above
  • Node.js v12 or above

Installation

ember install ember-cli-dfinity

On-chain Dapp

If you are building the app to run on the Internet Computer, then you must install the dfx-ember-webpack-plugin Webpack plugin into the dfx project so it builds the EmberJS asset canister correctly.

Steps for Building Your Dapp

The following steps are necessary for building an Internet Computer dapp with an EmberJS front-end. These steps are listened here from historical reasons. They will be completely automated in future releases of the add-on.

  • Copy all JavaScript candid (*.did.js) declarations in ./src/declarations, which is generated by dfx, to ./app/dfx in the EmberJS application.

  • Define one or more agents in config/environment.js (see Configuring your application.)

Configuring your application

The config/environment.js file is where you configure how the Dapp connects to the Internet Computer. The most important section in the configuration is dfx.agents. This is where you define different agents that canisters use to communicate. The $default agent must always be defined. Below is an example configuration that will use the local network. You can customize the configuration for different environments, such as production vs test.

// config/environment.js

module.exports = function (environment) {
  let ENV = {
     // ...

     dfx: {
        canisters: {
          // Optional. You can define caninsters not defined in canister_ids.json, or
          // override the existing canister ids here.
        },
        
        agents: {
           $default: {
              host: 'http://127.0.0.1:8000',
           },
        },
     }
  }; 
   
  // ...
}

Next Steps

Check out the dummy application in tests/dummy for an example on how to integrate canisters from the Internet Computer into your application. We will provide more guidance on this over the course of the project.

Contributing

See the Contributing guide for details.

License

This project is licensed under the Apache-2.0.

Keywords

ember-addon

FAQs

Package last updated on 10 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts