1.2.0 • Published 10 months ago

next-twa v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Telegram WebApp and NextJS

Getting started

Installation

npm i next-twa --save

Usage

Import NextTWAProvider from the library

import { NextTWAProvider } from 'next-twa';

Then wrap your code in NextTWAProvider component to make it available to all components. next-twa will take care of the back button

<NextTWAProvider>
  <App />
</NextTWAProvider>

Now you can call useNextTWA in any component.

import { useNextTWA } from 'next-twa';

export const MyComponent = () => {
  const { app } = useNextTWA();

  return <p>Hi, {app?.initDataUnsafe.user?.username}</p>;
};
1.2.0

10 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.2.1-0

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.1.2

10 months ago

1.1.3-0

10 months ago

1.0.5

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0-1

10 months ago

1.0.0

10 months ago