The code examples in this directory demonstrate how to work with Amazon Personalize using the AWS SDK for JavaScript version 3 (v3).
Amazon Personalize is a fully managed machine learning service that makes it easy for developers to deliver personalized experiences to their users.
This directory contains the following SDK for JavaScript (v3) examples for Amazon Personalize:
- Create a batch inference job (CreateBatchInferenceJobCommand)
- Create a batch segment job (CreateBatchSegmentJobCommand)
- Create a campaign (CreateCampaignCommand)
- Create a dataset (CreateDatasetCommand)
- Create a dataset export job (CreateDatasetExportJobCommand)
- Create a dataset group (CreateDatasetGroupCommand)
- Create a dataset import job (CreateDatasetImportJobCommand)
- Create a domain dataset group (CreateDatasetGroupCommand)
- Create a domain schema (CreateSchemaCommand)
- Create an event tracker (CreateEventTrackerCommand)
- Create a filter (CreateFilterCommand)
- Create a recommender (CreateRecommenderCommand)
- Create a schema (CreateSchemaCommand)
- Create a solution (CreateSolutionCommand)
- Create a solution version (CreateSolutionVersion)
- Get a personalized ranking (GetPersonalizedRankingCommand)
- Get recommendations (custom dataset group) (GetRecommendationsCommand)
- Get recommendations from a recommender (domain dataset group) (GetRecommendationsCommand)
- Get recommendation with a filter (custom dataset group) (GetRecommendationsCommand)
- Put events (PutEventsCommand)
- Put items (PutItemsCommand)
- Put users (PutUsersCommand)
Note: All code examples are written in ECMAscript 6 (ES6). For guidelines on converting to CommonJS, see JavaScript ES6/CommonJS syntax.
- Running this code might result in charges to your AWS account.
- We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see Grant least privilege in the AWS Identity and Access Management User Guide.
- This code is not tested in every AWS Region. Some AWS services are available only in specific AWS Regions. For more information, see the AWS Regional Services.
- An AWS account. To create an account, see How do I create and activate a new AWS account on the AWS Premium Support website.
- AWS credentials. For details, see Setting credentials in Node.js in the AWS SDK for JavaScript (v3) Developer Guide.
-
Clone the AWS SDK Code Samples repo to your local environment. For instructions, see the the Github documentation.
-
Install the dependencies listed in the package.json.
cd javascriptv3/example_code/personalize/src
npm install
-
In your text editor, update the user variables specified in the
Inputs
section of the sample file. -
Run the following sample code:
cd src
node [example name].js