ShipEngine Connect applications are just NPM packages that meet the following requirements:
package.jsonfile in the root directory, which specifies its name, version number, and dependencies.
@shipengine/connect-runtimepackage as a
Have the appropriate app definition package as a
package.jsonfile based on the type of app you're developing.
Export an object with properties and methods that define the app's capabilities and functionality.
Other than that, everything else is up to you. We don't impose any specific folder structure or file naming convention. You can build your app just as you would build any other NPM package.
The ShipEngine Connect CLI makes it easy to get started with your app. It comes with built-in templates for each app type.
Just run the
connect init command, answer a few questions, and it'll create all the files and pre-populate much of the basic scaffolding for you.
For more details, see Creating Your First App.
The main export of your app's NPM package must be an object that defines your app's capabilities and functionality. The properties and methods of this object depend on the type of app you're building.
As mentioned above, the main export of your application package must be an Application Definition object, which has properties and methods. The properties define your app's capabilities and features, but the methods provide your app's actual implementation. As you can imagine, the methods are probably where you'll spend most of your time when building an app.
1) Transform the input data into whatever structure is needed by your API.
2) Call your API(s) to perform whatever operations are necessary and/or to retrieve whatever data was requested.
3) Transform the data from your API into the structure that's needed by ShipEngine Connect.
4) Return the data.
Forms are used gather data from an end-user that is interacting with your application from within one of our e-commerce applications. For example, you will need to supply a connection form that gathers login credentials from the end user so they can be authenticated with your API.
In addition to the application definition, some application types include definition files for the services it provides. For example, each type of delivery service offered by a Carrier app will be described by a delivery service definition file.