Skip to content

Commit

Permalink
feat(new-events): web_app_request_fullscreen
Browse files Browse the repository at this point in the history
web_app_exit_fullscreen
web_app_switch_inline_query
web_app_open_link
web_app_open_tg_link
web_app_open_invoice
web_app_share_to_story
web_app_ready
web_app_close
  • Loading branch information
vladzima committed Dec 6, 2024
0 parents commit 3500387
Show file tree
Hide file tree
Showing 40 changed files with 10,966 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +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
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
.env

node_modules
dist
lib
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"endOfLine": "crlf"
}
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
![](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

![Alt](https://repobeats.axiom.co/api/embed/71dde1ce0ebd118019e03f5e9ba6a9d0898f3d70.svg "Repobeats analytics image")

## Telemetree SDKs for Telegram Mini App Analytics

Telemetree is a comprehensive free analytics tool designed specifically for **Telegram Mini Apps**. With our SDKs, developers, marketers, and product managers can easily track and optimize user engagement, making data-driven decisions to boost user acquisition and retention. Telemetree simplifies **Analytics for Telegram Mini Apps** by delivering insights into user behaviors, acquisition channels, and in-app interactions.

### Key Features
- **Real-Time Analytics**: Monitor user activity within your Telegram Mini App in real-time.
- **User Retention Metrics**: Track returning users and pinpoint which features encourage app retention.
- **Web3 data**: discover web3 metrics associated with your users.
- **Seamless Integration**: Our SDKs are lightweight and integrate easily with auto event mapping.
- **Telegram-native**: Telemetree is built natively for Telegram.
- **User segmentation**: API for personalized notifications based on cohorts, completed actions. web3 data and more.
- **Free tier** with wide limits.

### Why Use Telemetree for Telegram Mini App Analytics?

Telemetree is uniquely focused on the needs of Telegram Mini App developers, providing tailored metrics and insights that help you grow and retain your user base efficiently. As the demand for Analytics for Telegram Mini Apps grows, Telemetree remains at the forefront, offering tools that cater specifically to the Telegram ecosystem.

Start capturing valuable insights with Telemetree and make data-driven decisions for your app's growth on Telegram.

## Resources
Consider visiting our resources for more info about the state of the Telegram Mini Apps ecosystem and Telegram analytics.

- [Website](https://www.telemetree.io/)
- [Twitter](https://x.com/telemetree_HQ)
- [Telegram channel](https://t.me/telemetree_en)
- [LinkedIn](https://linkedin.com/company/telemetree)
- [Medium](https://medium.com/@telemetree)
- [Documentation](https://docs.telemetree.io/)

# 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',
});
```
## Other SDKs
Telemetree SDKs are available for various frameworks and environments, making it easy to incorporate powerful analytics into any Telegram Mini App.
- React SDK: https://github.com/TONSolutions/telemetree-react
- Node.js SDK: https://github.com/TONSolutions/telemetree-node
- .NET SDK: https://github.com/MANABbl4/Telemetree.Net (community-supported)
10 changes: 10 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Telegram } from './src/telegram';

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

0 comments on commit 3500387

Please sign in to comment.