ThingWorx Flow > ThingWorx Flow SDK > Tutorial A: Implement a Custom Connector Using ThingWorx Flow SDK
Tutorial A: Implement a Custom Connector Using ThingWorx Flow SDK
Installing Flow Tools and SDK On Premise
ThingWorx Flow Tools and SDK are already installed by the ThingWorx Flow on premise installer. To create a new connector project, follow the steps:
1. Navigate to your workspace from the Windows command line.
2. Create a new project by executing the following command:
flow init <PROJECT_NAME>
* 
ThingWorx Flow connector project has a node npm dependency on the ptc-flow-sdk package.
3. To install this npm dependency, navigate to the project directory, and then execute the following command:
npm link ptc-flow-sdk
4. Install the flow test helper library by executing the following command in your project directory:
npm link ptc-flow-test-helper
5. Run the following command:
npm install
6. Verify that the connector is set up correctly by executing the following command in your project directory:
npm test
Execution of this command runs the unit tests that are automatically included when a project is created.
To configure NPM and node to work with proxy servers, refer to the section Configuring NPM and Node to Work with Proxy Servers.
Installing ThingWorx Flow Tools On a Developer Workstation
The ThingWorx Flow Connectors SDK and tools are available on npmjs.org. This mechanism can be used to install the tools on your development environment.
To configure NPM and node to work with proxy servers, refer to the section Configuring NPM and Node to Work with Proxy Servers.
To install the ThingWorx Flow tools on a developer system, do the following:
1. To install ThingWorx Flow CLI globally, execute the following command:
npm install ptc-flow-cli@<Tool version> -g
Check the <Tool version> for your version of ThingWorx Flow here.
2. To install ThingWorx Flow deploy tool globally, execute the following command:
npm install ptc-flow-deploy@<Tool version> -g
Check the <Tool version> for your version of ThingWorx Flow here.
The ptc-flow-sdk and ptc-flow-test-helper library is automatically installed in your project directory once you execute the npm install command in your project directory.
To create a new connector project, follow the steps:
1. Navigate to your workspace from the Windows command line.
2. Create a new project by executing the following command:
flow init <PROJECT_NAME>
* 
ThingWorx Flow connector project has a node npm dependency on the ptc-flow-sdk package.
3. Navigate to your project.
cd <PROJECT_NAME>
4. Run the following command:
npm install
5. Verify that the connector is set up correctly by executing the following command in your project directory:
npm test
Execution of this command runs the unit tests that are automatically included when a project is created.
Configuring NPM and Node to Work with Proxy Servers
If you are using proxies to connect to the internet, do the following:
npm config set proxy <proxy-url>
Eg npm config set proxy http://proxy.company.com:8080
npm config set https-proxy <proxy-url>
npm config set https-proxy http://proxy.company.com:8080
Refer to the npmjs Web site for details on using proxies with node js.
Was this helpful?