Skip to content

weblog-sdk 2.2.5

Install from the command line:
Learn more about npm packages
$ npm install @particlemedia/weblog-sdk@2.2.5
Install via package.json:
"@particlemedia/weblog-sdk": "2.2.5"

About this version

weblog-sdk

1. Create a Product

https://data.n.newsbreak.com/product/create

2. Add SDK

npx pnpm @ParticleMedia/weblog-sdk
import { Weblog } from '@ParticleMedia/weblog-sdk/index.esm';
import type { Weblog as WeblogType } from '@ParticleMedia/weblog-sdk/index.esm.d';

const weblog = new Weblog({
    product_name: 'NEWSBREAK',
    product_id: 1,
});

weblog.send("CLICK_BTN",{
    btn_name: "like",
    btn_id: 1,
});
weblog.send("PV",{
    page_name: detail,
})

API


updateBaseOptions(data: Partial): GlobalType

Updates the base options of the schema with the provided data and returns the updated global object.

setPage(id: number, name?: string): void

Sets the page id and name in the schema.

setUserId(user_id: string): void

Sets the user id in the schema.

updateNetwork(): void

Updates the network information in the schema.

updateUUID(): void

Updates the log id in the schema.

QA:

  1. Q: why yarn add or npm install show error A: run commmand npm config edit and add code in newline
     @ParticleMedia:registry=https://npm.pkg.github.com/
    

Details


Assets

  • weblog-sdk-2.2.5.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0