Unomi Node
1.0.1
1.0.1
  • Apache Unomi Node.js SDK
  • Contribute
  • API
    • Profile
      • Create
      • Delete
      • Get
      • Count
      • Existing Properties
      • All Properties
      • Sessions
      • Get by Single Property
      • Query
    • Rule
      • Create
      • Get
      • Get All
    • Segment
Powered by GitBook
On this page
  • Usage
  • Response
  • Real World Example

Was this helpful?

  1. API
  2. Profile

Create

Create a new Profile

Usage

unomi.profile.create({
  version: <int>,
  properties: { <object> },
  systemProperties: { <object> },
  segments: <string[]>,
  mergedWith: <string>,
  scores: <string | number>
});

Response

{
  success: <boolean>,
  status:  <number, HTTP status code>,
  data:    <object>
}

Real World Example

async function createProfile(id, properties, version) {

  try {
  
    const profile = await unomi.profile.create({ itemId: id, properties, version });
    console.log(Profile ${profile.data.itemId} successfully created.);
  
  } catch (err) {
    console.error("An error occurred while creating user " + id);
    console.error(err);
  }

}
PreviousProfileNextDelete

Last updated 5 years ago

Was this helpful?