# @types/react-gtm-module

> TypeScript definitions for react-gtm-module

Latest version **2.0.4** (published 2024-10-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/react-gtm-module
pnpm add @types/react-gtm-module
yarn add @types/react-gtm-module
bun add @types/react-gtm-module
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2024-10-18 |
| First published | 2019-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51432 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/react-gtm-module
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-gtm-module
- npm.io page: https://npm.io/package/@types/react-gtm-module

## Recent versions

- 2.0.4 (latest) — 2024-10-18
- 2.0.3 (ts4.7) — 2023-11-07
- 2.0.1 (ts3.6) — 2021-07-07
- 2.0.0 (ts3.2) — 2019-05-22
- 2.0.2 — 2023-10-18

## README

# Installation
> `npm install --save @types/react-gtm-module`

# Summary
This package contains type definitions for react-gtm-module (https://github.com/alinemorelli/react-gtm).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-gtm-module.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-gtm-module/index.d.ts)
````ts
declare const TagManager: {
    dataLayer: (dataLayerArgs: TagManager.DataLayerArgs) => void;
    initialize: (tagManagerArgs: TagManager.TagManagerArgs) => void;
};

declare namespace TagManager {
    interface TagManagerArgs extends DataLayerArgs {
        /**
         * GTM id, must be something like GTM-000000.
         */
        gtmId: string;
        /**
         * Additional events such as 'gtm.start': new Date().getTime(),event:'gtm.js'.
         */
        events?: object | undefined;
        /**
         * Used to set environments.
         */
        auth?: string | undefined;
        /**
         * Used to set environments, something like env-00.
         */
        preview?: string | undefined;
    }

    interface DataLayerArgs {
        /**
         * Object that contains all of the information that you want to pass to Google Tag Manager.
         */
        dataLayer?: object | undefined;
        /**
         * Custom name for dataLayer object.
         */
        dataLayerName?: string | undefined;
    }
}

export = TagManager;

````

### Additional Details
 * Last updated: Fri, 18 Oct 2024 18:09:36 GMT
 * Dependencies: none

# Credits
These definitions were written by [Marc Veens](https://github.com/marcveens).

---
_Source: https://npm.io/package/@types/react-gtm-module · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
