Skip to content

Commit

Permalink
fix: update org name
Browse files Browse the repository at this point in the history
  • Loading branch information
gtupak committed Aug 6, 2024
1 parent 6fbf550 commit 9b413ea
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 28 deletions.
14 changes: 3 additions & 11 deletions MIGRATION_GUIDE_v1_to_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Upgrade to v2 for bug fixes, new features, and better data quality. The SDK v2 h
- **Signature Hash**: Optionally pass in `signature()`.
- **Device Info**: Including user agent, language, browser data, OS, and resolution.



## Technical Changes

#### Changed
Expand All @@ -28,8 +26,6 @@ Upgrade to v2 for bug fixes, new features, and better data quality. The SDK v2 h
- `signature()`: To track signature events.
- `disconnection()`: New function to track wallet disconnects.



## Migration Guide

### For Metamask-only dApps
Expand All @@ -45,13 +41,11 @@ You're set with the script tag. No changes needed.

**For React Users**

- Follow [Option 2](https://github.com/arcxmoney/analytics-sdk#option-3-via-manual-instantiation) to install. Use the saved API key like this: `<ArcxAnalyticsProvider apiKey={YOUR_API_KEY} />`.
- Follow [Option 2](https://github.com/0xarc-io/analytics-sdk#option-3-via-manual-instantiation) to install. Use the saved API key like this: `<ArcxAnalyticsProvider apiKey={YOUR_API_KEY} />`.

**For Non-React Users**

- Check out [Option 3](https://github.com/arcxmoney/analytics-sdk#option-3-via-manual-instantiation) for installation steps.


- Check out [Option 3](https://github.com/0xarc-io/analytics-sdk#option-3-via-manual-instantiation) for installation steps.

#### NPM Package Users

Expand All @@ -63,6 +57,4 @@ You're set with the script tag. No changes needed.
4. Rename: `connectWallet()` -> `wallet()`.
5. Implement: `transaction()`, `wallet()`, `chain()`, `signature()`.



[Consult the API Docs for more info](https://github.com/arcxmoney/analytics-sdk)
[Consult the API Docs for more info](https://github.com/0xarc-io/analytics-sdk)
16 changes: 6 additions & 10 deletions example/cra-provider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,18 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo

If you have a React app, one easy way to integrate the SDK is to simply add the `ArcxAnalyticsProvider` at the root of your application:

You must pass an `API_KEY` as specified in the [SDK's documentation](https://github.com/arcxmoney/analytics-sdk) and, optionally, a `config` object. This is the same `config` as described [here](https://github.com/arcxmoney/analytics-sdk#init).
You must pass an `API_KEY` as specified in the [SDK's documentation](https://github.com/0xarc-io/analytics-sdk) and, optionally, a `config` object. This is the same `config` as described [here](https://github.com/0xarc-io/analytics-sdk#init).

```jsx
return (
<ArcxAnalyticsProvider apiKey={API_KEY} config={config}>
...the rest of your app here
</ArcxAnalyticsProvider>
<ArcxAnalyticsProvider apiKey={API_KEY} config={config}>
...the rest of your app here
</ArcxAnalyticsProvider>
)
```

Then, in children components, you will have access to the `useArcxAnalytics()` hook which exposes an instance of the SDK, as described by the API [here](https://github.com/arcxmoney/analytics-sdk#api).
Then, in children components, you will have access to the `useArcxAnalytics()` hook which exposes an instance of the SDK, as described by the API [here](https://github.com/0xarc-io/analytics-sdk#api).

## Note

You can test this app with the local package by linking it locally with [yarn link](https://classic.yarnpkg.com/lang/en/docs/cli/link/). If you face "two copies of react" problems, you can fix it by temporarily linking the `react` and `@types/react` folders in `/` to `/example/node_modules/{react,@types/react}`. You can do that by runinng:

1. In `example/node_modules/react`, run `yarn link`
2. In `example/node_modules/@types/react` run `yarn link`
3. In the project directory, run `yarn link react && yarn link @types/react && yarn`
You can test this app with the local package by linking it locally with [yarn link](https://classic.yarnpkg.com/lang/en/docs/cli/link/). If you face "two copies of react" problems, you can fix it by removing the packages `react, react-dom, @types/react` from `/` after you have built the package.
4 changes: 2 additions & 2 deletions example/cra-script-tag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ Simply add the following script in the header of your application:
</script>
```

You must replace `YOUR_API_KEY` with your API key as specified in the [SDK's documentation](https://github.com/arcxmoney/analytics-sdk) and, optionally, pass a `config` object. This is the same `config` as described [here](https://github.com/arcxmoney/analytics-sdk#init).
You must replace `YOUR_API_KEY` with your API key as specified in the [SDK's documentation](https://github.com/0xarc-io/analytics-sdk) and, optionally, pass a `config` object. This is the same `config` as described [here](https://github.com/0xarc-io/analytics-sdk#init).

Then, you will have access to the `window.arcx` which is an instance of the SDK, which API is described [here](https://github.com/arcxmoney/analytics-sdk#api).
Then, you will have access to the `window.arcx` which is an instance of the SDK, which API is described [here](https://github.com/0xarc-io/analytics-sdk#api).
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "@arcxmoney/analytics",
"version": "1.1.0",
"name": "@0xarc/analytics",
"version": "2.2.2",
"repository": {
"type": "git",
"url": "https://github.com/arcxmoney/arcx-analytics.git"
"url": "https://github.com/0xarc-io/arcx-analytics.git"
},
"author": "Yaraslau Stsetskevich <j@arcx.money>",
"main": "dist/cjs/src/index.js",
"types": "dist/esm/src/index.d.ts",
"module": "dist/esm/src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion test/ArcxAnalyticsProvider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('(int) ArcxAnalyticxProvider', () => {
postRequestStub = sinon.stub(postRequestModule, 'postRequest').resolves(TEST_IDENTITY)

// Stub _trackPagesChange because requestAnimationFrame throws during testing
// To be fixed in https://github.com/arcxmoney/analytics-sdk/issues/23
// To be fixed in https://github.com/0xarc-io/analytics-sdk/issues/23
sinon.stub(ArcxAnalyticsSdk.prototype, '_trackPagesChange' as any)
})

Expand Down

0 comments on commit 9b413ea

Please sign in to comment.