Skip to content

Commit

Permalink
feat: expose ym object
Browse files Browse the repository at this point in the history
  • Loading branch information
reapziq committed Mar 3, 2024
1 parent e2a441f commit a67c06f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,17 @@ export function ActionButton() {
// ...
}
```

In case if you need to use the Yandex.Metrica object directly, you can access it using the `ym` property.

```jsx
import { ym } from 'next-yandex-metrica';

export function ActionButton() {
return (
<button type="button" onClick={() => ym(12345678, 'reachGoal', 'cta-click')}>
CTA
</button>
);
}
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-yandex-metrica",
"version": "1.1.1",
"version": "1.1.2",
"description": "Yandex Metrica integration for Next.js",
"files": [
"dist"
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { YandexMetricaProvider } from './components/YandexMetricaProvider';
export { useMetrica } from './hooks/useMetrica';
export { ym } from './lib/ym';

0 comments on commit a67c06f

Please sign in to comment.