# @magensa/te-connect-ng

> Angular components for use with TEConnect

Latest version **3.0.0** (published 2026-11-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @magensa/te-connect-ng
pnpm add @magensa/te-connect-ng
yarn add @magensa/te-connect-ng
bun add @magensa/te-connect-ng
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-11-04 |
| First published | 2020-10-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 142.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Magensa LLC |
| Maintainers | magensa-admin-team, luketurpin |

## Links

- npm: https://www.npmjs.com/package/@magensa/te-connect-ng
- Repository: https://github.com/Magensa/TEConnect
- Homepage: https://github.com/Magensa/TEConnect#readme
- Issues: https://github.com/Magensa/TEConnect/issues
- npm.io page: https://npm.io/package/@magensa/te-connect-ng

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.3.0

## Recent versions

- 3.0.0 (latest) — 2026-11-04
- 2.0.0 — 2025-04-02
- 1.2.3 — 2024-09-20
- 1.2.2 — 2023-10-10
- 1.2.1 — 2023-10-02
- 1.2.0 — 2022-11-17
- 1.1.0 — 2022-02-14
- 1.0.6 — 2021-08-25
- 1.0.5 — 2021-03-01
- 1.0.4 — 2021-03-01
- 1.0.3 — 2020-10-29
- 1.0.2 — 2020-10-29
- 1.0.1 — 2020-10-29
- 1.0.0 — 2020-10-29

## README

# @magensa/te-connect-ng

[![npm version](https://img.shields.io/npm/v/@magensa/te-connect-ng.svg?style=for-the-badge)](https://www.npmjs.com/package/@magensa/te-connect-ng "@magensa/te-connect-ng npm.js")

Angular components used to interact with TEConnect.

> This release is an **Angular 21** upgrade and modernization of the previous Angular 19 build. The components are standalone, signal-based, `OnPush`, and **zoneless-safe** — they render correctly under both zone-based and zoneless host applications. The public component selectors and input names are unchanged, so existing templates continue to work; the major version reflects the tightened public TypeScript types.

## Installation

```
npm install @magensa/te-connect @magensa/te-connect-ng
```

## Peer dependencies

| Package | Version |
|---------|---------|
| `@angular/core` | `^21.0.0` |
| `@angular/common` | `^21.0.0` |

`@magensa/te-connect` is required at runtime — you create a TEConnect instance with it and pass that instance into each component's `teConnect` input. It is intentionally **not** a declared dependency of this package.

## Quick start

Import the standalone component(s) you need directly — there is no NgModule.

```typescript
import { Component } from '@angular/core';
import { createTEConnect } from '@magensa/te-connect';
import { TeConnectNgComponent } from '@magensa/te-connect-ng';
import type { CreatePaymentResponse } from '@magensa/te-connect-ng';

@Component({
  selector: 'app-checkout',
  imports: [TeConnectNgComponent],
  template: `
    <lib-te-connect-ng
      [teConnect]="teConnect"
      [stylesConfig]="styles"
      (teResponse)="onResponse($event)"
    ></lib-te-connect-ng>
    <button type="button" (click)="frame.createPayment()">Create Payment</button>
  `,
})
export class CheckoutComponent {
  teConnect = createTEConnect('__your_public_key_here__');
  styles = { base: { backgroundColor: '#fff' } };

  onResponse(resp: CreatePaymentResponse) {
    console.log(resp);
  }
}
```

To invoke `createPayment()` programmatically, grab the component via a template reference or `viewChild()` and call `createPayment(billingZip?)`, which resolves to a `CreatePaymentResponse` and also emits `teResponse`.

## Components

| Selector | Component | Purpose |
|----------|-----------|---------|
| `lib-te-connect-ng` | `TeConnectNgComponent` | Secure card-entry iframe + `createPayment`. |
| `lib-tec-threeds` | `TecThreedsComponent` | 3DS card-entry iframe + `createPayment`, with a `threeDsStatus` listener. |
| `lib-tec-payment-request` | `TecPaymentRequestComponent` | Apple Pay / Google Pay payment-request buttons. |

Full integration documentation (styles, Payment Request, and 3DS) is maintained at
[github.com/Magensa/TEConnect](https://github.com/Magensa/TEConnect/blob/main/angular/manual-card-entry.md).

## Build outputs

`ng build te-connect-ng` produces an Angular Package Format distribution in `dist/te-connect-ng`:

| Output | Purpose |
|--------|---------|
| `fesm2022/magensa-te-connect-ng.mjs` | Flat ESM bundle (+ source map) |
| `types/magensa-te-connect-ng.d.ts` | Generated TypeScript declarations |
| `package.json` | Publish manifest (peer deps, `exports`, `sideEffects: false`) |

## Development

```bash
npm install
npm run build          # ng build te-connect-ng (ng-packagr / APF)
npm test               # Vitest unit tests (jsdom, zoneless)
npm run test:watch     # Watch mode
npm run test:coverage  # Coverage (v8)
```

## License

[MIT](./LICENSE)

---
_Source: https://npm.io/package/@magensa/te-connect-ng · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
