Skip to content

Commit

Permalink
refactor(config,-tests): added main config file, refactored variables…
Browse files Browse the repository at this point in the history
…, added unit tests for base functions
  • Loading branch information
vladzima committed Aug 6, 2024
1 parent 61101bf commit 3da59ad
Show file tree
Hide file tree
Showing 18 changed files with 9,564 additions and 3,436 deletions.
48 changes: 24 additions & 24 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
on:
workflow_dispatch: {}
pull_request: {}
push:
branches:
- main
- master
paths:
- .github/workflows/semgrep.yml
schedule:
# random HH:MM to avoid a load spike on GitHub Actions at 00:00
- cron: 43 9 * * *
name: Semgrep
jobs:
semgrep:
name: semgrep/ci
runs-on: ubuntu-20.04
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
container:
image: returntocorp/semgrep
steps:
- uses: actions/checkout@v3
- run: semgrep ci
on:
workflow_dispatch: {}
pull_request: {}
push:
branches:
- main
- master
paths:
- .github/workflows/semgrep.yml
schedule:
# random HH:MM to avoid a load spike on GitHub Actions at 00:00
- cron: 43 9 * * *
name: Semgrep
jobs:
semgrep:
name: semgrep/ci
runs-on: ubuntu-20.04
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
container:
image: returntocorp/semgrep
steps:
- uses: actions/checkout@v3
- run: semgrep ci
10 changes: 5 additions & 5 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"endOfLine": "crlf"
}
{
"singleQuote": true,
"trailingComma": "all",
"endOfLine": "crlf"
}
114 changes: 60 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,60 @@
![](https://tc-images-api.s3.eu-central-1.amazonaws.com/gif_cropped.gif)

# TON Solutions Telemetree library for React.js
![Static Badge](https://img.shields.io/badge/build-passing-brightgreen?style=flat) ![GitHub top language](https://img.shields.io/github/languages/top/tonsolutions/telemetree-react) ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/tonsolutions/telemetree-react)

To learn more about the SDK, here are some useful links:
- Documentation: https://docs.telemetree.io/
- Boilerplate: https://github.com/TONSolutions/react-twa-boilerplate

## Installation

Install it from [NPM](https://www.npmjs.com/package/@tonsolutions/telemetree-react):
```
$ npm install @tonsolutions/telemetree-react
```

## How to use
Call this script in `<head>`:

```html
<script src="https://telegram.org/js/telegram-web-app.js"></script>
```
In your app:

```javascript
import { TwaAnalyticsProvider } from '@tonsolutions/telemetree-react';

export function App() {
return (
<TwaAnalyticsProvider
projectId='YOUR_PROJECT_ID'
apiKey='YOUR_API_KEY'
appName='YOUR_APPLICATION_NAME'
>
...
</TwaAnalyticsProvider>
);
}
```

```js
import { useTWAEvent } from '@tonsolutions/telemetree-react';

const builder = useTWAEvent();
builder.track('transfer', {
amount: 1000,
method: 'TON',
});
```

## User data and Processing
This library is designed to automatically retrieve user data from Telegram, enhancing your events with valuable insights.

Adhering to Telegram's high standards of security, we employ RSA encryption for the transmission of data across networks, ensuring both the integrity and safety of your analytics processes
![](https://tc-images-api.s3.eu-central-1.amazonaws.com/gif_cropped.gif)

# TON Solutions Telemetree library for React.js

![Static Badge](https://img.shields.io/badge/build-passing-brightgreen?style=flat) ![GitHub top language](https://img.shields.io/github/languages/top/tonsolutions/telemetree-react) ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/tonsolutions/telemetree-react)

To learn more about the SDK, here are some useful links:

- Documentation: https://docs.telemetree.io/
- Boilerplate: https://github.com/TONSolutions/react-twa-boilerplate

## Installation

Install it from [NPM](https://www.npmjs.com/package/@tonsolutions/telemetree-react):

```
$ npm install @tonsolutions/telemetree-react
```

## How to use

Call this script in `<head>`:

```html
<script src="https://telegram.org/js/telegram-web-app.js"></script>
```

In your app:

```javascript
import { TwaAnalyticsProvider } from '@tonsolutions/telemetree-react';

export function App() {
return (
<TwaAnalyticsProvider
projectId="YOUR_PROJECT_ID"
apiKey="YOUR_API_KEY"
appName="YOUR_APPLICATION_NAME"
>
...
</TwaAnalyticsProvider>
);
}
```

```js
import { useTWAEvent } from '@tonsolutions/telemetree-react';

const builder = useTWAEvent();
builder.track('transfer', {
amount: 1000,
method: 'TON',
});
```

## User data and Processing

This library is designed to automatically retrieve user data from Telegram, enhancing your events with valuable insights.

Adhering to Telegram's high standards of security, we employ RSA encryption for the transmission of data across networks, ensuring both the integrity and safety of your analytics processes
20 changes: 10 additions & 10 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Telegram } from "./src/telegram";

declare global {
interface Window {
Telegram?: {
WebApp: Telegram.WebApp;
WebView: Telegram.WebView;
};
}
}
import { Telegram } from './src/telegram';

declare global {
interface Window {
Telegram?: {
WebApp: Telegram.WebApp;
WebView: Telegram.WebView;
};
}
}
Loading

0 comments on commit 3da59ad

Please sign in to comment.