open-index/open-npm huggingface dataset:
npm package: @scaleds/components-react
Description: React proxy for @scaleds/components
Latest version: 0.1.4

# Scale-React
A React Proxy for Scale Components

## Installation
- To installl run `yarn add @scaleds/components-react`

## Usage
```
import React from 'react';
import { ScaleButton } from '@scaleds/components-react';

const App: React.FC = () => (
  <div className="app">
    <h3 style={{ color: colors.primary.default }}>
      Button
    </h3>
    <ScaleButton variant="primary">Click!</ScaleButton>
  </div>
);
```
npm package: @scaleds/scale-react
Description: React proxy for @scaleds/components
Latest version: 0.1.3
Deprecated: please use @scaleds/components-react

# Scale-React
A React Proxy for Scale Components

## Installation
- To installl run `yarn add @scaleds/scale-react`

## Usage
```
import React from 'react';
import { ScaleButton } from '@scaleds/scale-react';

const App: React.FC = () => (
  <div className="app">
    <h3 style={{ color: colors.primary.default }}>
      Button
    </h3>
    <ScaleButton variant="primary">Click!</ScaleButton>
  </div>
);
```
npm package: @scalef/auth
Description: ScaleF Auth
Author: Vu Duc Dung
Latest version: 1.0.8

## Installation
```base
$ npm install @scalef/auth
```

## Usage
```js
const { newOauth2 } = require('@scalef/auth')

const auth = newOauth2({
    clientID: 'clientapp',
    clientSecret: '123456',
    endpoint: {
        authURL: 'https://sso.directsale.vn/oauth/authorize',
        tokenURL: 'https://sso.directsale.vn/oauth/token'
    },
    redirectURL: '',
    scopes: ['user_info', 'read', 'write']
})
```

<table>
<tbody>
<tr>
<th>Properties</th>
<th>Type</th>
<td>Required</td>
<th>Description</th>
</tr>
<tr>
<td>clientID</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<tr>
<td>clientSecret</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<tr>
<td>endpoint.authURL</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<tr>
<td>endpoint.tokenURL</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<tr>
<td>redirectURL</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<tr>
<td>scopes</td>
<td>array of string</td>
<td>true</td>
<td></td>
</tr>
</tbody>
</table>

### Get password credentials token 
```js
const token = await auth.passwordCredentialsToken(username, password)
```

Example
```js
const username = 'MID6900@metu.vn'
const password = '666666666'
```

<table>
<tbody>
<tr>
<th>Properties</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
<tr>
<td>username</td>
<td>string</td>
<td>true</td>
<td>The username account of member</td>
</tr>
<tr>
<td>password</td>
<td>string</td>
<td>true</td>
<td>The password account of member</td>
</tr>
</tbody>
</table>

### New token source
```js
const { newTokenSource } = require('@scalef/auth')

const tokenSource = newTokenSource(oauth2, token)
```

### New token
```js
const { newToken } = require('@scalef/auth')

const token = newToken(data)
```

<table>
<tbody>
<tr>
<th>Properties</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
<tr>
<td>accessToken</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<tr>
<td>tokenType</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<tr>
<td>refreshToken</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
<tr>
<td>expirationTime</td>
<td>string</td>
<td>true</td>
<td></td>
</tr>
</tbody>
</table>
npm package: @scalef/sdk
Description: ScaleF SDK NodeJS
Author: Vu Duc Dung
Latest version: 1.0.19

## Installation
```base
$ npm install @scalef/sdk
```

## Usage
```js
const { newScaleF } = require('@scalef/sdk')

const scalef = newScaleF({
    netID: 1,
    portType: 'PUB',
    baseURL: 'https://pub-be-stag.mp.directsale.vn',
    version: 'v1'
})
```

### Set token source
```js
scalef.setTokenSource(tokenSource)
```

### Create member
```js
const member = await scalef.newMember({
    memberID: 'MID01',
    email: 'MID01@metu.vn',
    password: '696969'
})
```

### Get referral link
```js
const link = await scalef.referralLink(campaignID, memberID)
```

### Push event
```js
await scalef.pushEvent(memberID, eventType, createdTime, clickID)
```