Box Skills Kit is Generally Available

Connect AI with Box in just a few lines of code

Box Developers
Box Developer Blog
6 min readDec 18, 2018

--

It’s here! We’re excited to announce that the Box Skills Kit — our developer toolkit for enhancing content in Box with AI — is now generally available. With the Box Skills Kit, you can build custom Box Skills that apply the AI technology of your choice to your content in Box.

To get started, you can visit the Box Developer Portal to explore our documentation and build your first Box Skill. You can also check out Box Skills samples built by members of our developer community.

Box Skills are a new type of application that automatically enhance content as it’s uploaded to Box. A Box Skill could, for example, analyze images using a computer vision algorithm to detect objects or extract text from those images and tag them in Box with metadata. The metadata applied by Box Skills improves the user experience in Box, informs our search capabilities, and can even trigger advanced functionality like automations and policies.

Box Skills enhance the user experience in Box by populating rich metadata derived from AI algorithms.

Using the Box Skills Kit

To show you how Box Skills work, we’ve created a simple, automated demo to get you going. In this demo, we’ll create and deploy a sample Box Skill that accepts a file and prints sample metadata to the file. Once you’ve successfully deployed the demo, you can modify the code and integrate the AI technology of your choice. You can see the code for this demo on Github.

Getting started

As pre-requisites for this demo, you’ll need the latest version of Node on your machine. We’ll also use a tool called Serverless to create and deploy the serverless application to on. You’ll need to select a cloud provider where you can deploy your Skill. Serverless provides documentation for working with each of the major serverless cloud platforms here. In this demo, we’ll use AWS Lambda.

Deploy the demo Skill application

Clone this Github project locally. We’ll use this demo as a starting point for the Skill application:

git clone https://github.com/box/box-skills-kit-nodejs.git

Next, deploy serverless-demo-automated code (in the Github project). Enter the directory and run the deploy command:

cd  box-skills-kit-nodejs/custom-skill-example-code/serverless-demo-automatednpm run deploy

This command will deploy the sample Skill application to the cloud provider you selected. You should see an output like this (example for deploying to AWS Lambda):

npm run deploy

> serverless-demo-automated@1.0.0 deploy /your-project-path/box-skills-kit/custom-skill-example-code/serverless-demo-automated
> npm install; ./node_modules/.bin/serverless deploy


> serverless-demo-automated@1.0.0 postinstall /your-project-path/box-skills-kit/custom-skill-example-code/serverless-demo-automated
> npm link ../../skills-kit-library

up to date in 0.589s
/your-home-path/.nvm/versions/node/v9.4.0/lib/node_modules/skills-kit-lib -> /your-project-path/box-skills-kit/skills-kit-library
/your-project-path/box-skills-kit/custom-skill-example-code/serverless-demo-automated/node_modules/skills-kit-library -> /your-home-path/.nvm/versions/node/v9.4.0/lib/node_modules/skills-kit-lib -> /your-project-path/box-skills-kit/skills-kit-library
removed 1 package in 4.768s
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Creating Stack...
Serverless: Checking Stack create progress...
.....
Serverless: Stack create finished...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service .zip file to S3 (13 MB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
..............................
Serverless: Stack update finished...
Service Information
service: my-quick-automated-demo
stage: dev
region: us-west-2
stack: my-quick-automated-demo-dev
api keys:
None
endpoints:
ANY - https://**********.execute-api.us-west-2.amazonaws.com/dev/my-quick-automated-demo
functions:
skill: my-quick-automated-demo-dev-skill

In the output, Serverless returns an endpoint for your application. In the example above, the endpoint is https://**********.execute-api.us-west-2.amazonaws.com/dev/my-quick-automated-demo. The endpoint can be used to invoke the serverless application with a HTTP request. Now that the sample Skill application is deployed, you’ll need to register your application with Box and provide your application’s endpoint so Box can invoke your function when an upload event occurs in Box.

Register a new Skill application in the Box Developer Console

To do create a Skill application in Box, we recommend signing up for a new Box Developer account. A Box Developer account provides you with your own instance of Box for which you are the primary admin.

Create a new app in the Box Developer Console:

Select “Custom Skill”:

Give your Skill application a name and click “Create App”.

Next, you’ll see your Skill’s configuration page in the Box Developer Console. On this page, you’ll see a Client ID for your Skill, a field to input an invocation URL for your Skill and a field to specify file extensions that your Skill can process.

Paste the endpoint you received in the Serverless output in the Invocation URL field. Once authorized (in the next step), Box will now send event notifications to this endpoint to trigger your Skill application. We’ll leave the File Extensions field blank for now. You can always edit the field later on.

Enable your Skill in the Box Admin Console

Last, you’ll need to authorize your Skill application to operate on your instance of Box. Log into the Box Admin Console and open the “Skills” page. Click “Add Skill,” and input the Client ID from your Skill’s configuration page in the Box Developer Console. You’ll only see the Skills menu in the Box Admin Console if you are logged in as the Primary Admin.

On the next page, you’ll select folders in Box where your Skill application can operate. You can select to enable the Skill to operate on either all content in your instance of Box or a whitelist of folders.

Once you select the folders where your Skill can operate, click “Enable” in the top-right corner. Accept the terms, and now your Skill is successfully enabled. If you are unable to enable your Skill, try following the instructions found on this page in our documentation.

Now that your Skill is enabled, any new content in the folders you selected in the Box Admin Console will trigger your Skill. The boilerplate Skill provided in this demo will write sample metadata to any files you upload.

What’s next?

You can extend and modify this demo to perform whatever type of processing you want — applying any service to any type of file uploaded to Box. We’ve compiled a collection of Box Skills samples built by Boxers and members of our developer community to show you the possibilities of the Box Skills framework.

To learn more about Box Skills, please visit our developer documentation. Here, you’ll find tutorials and sample code for building custom Box Skills. You can also register for our upcoming webinar to learn more about building Box Skills. If you have any questions, feel free to visit the Box Developer Forum or reach out to us on Twitter.

We can’t wait to see what you build!

--

--