# @hellocoop/cdk-client

> Hellō Client CDK Construct https://hello.dev

Latest version **2.9.0** (published 2026-07-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @hellocoop/cdk-client
pnpm add @hellocoop/cdk-client
yarn add @hellocoop/cdk-client
bun add @hellocoop/cdk-client
```

## Health

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

Positive: has types; no vulnerabilities; high maintenance score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.9.0 |
| Published | 2026-07-16 |
| First published | 2024-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=22 |
| Dependencies | 2 |
| Unpacked size | 456.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Hello Identity Co-op |
| Maintainers | dickhardt, rohanharikr |
| Keywords | lambda, serverless, cdk, construct, aws, hello, openid, oidc, sso |

## Links

- npm: https://www.npmjs.com/package/@hellocoop/cdk-client
- Repository: https://github.com/hellocoop/cdk-client
- Homepage: https://www.hello.dev/docs/sdks/cdk-client
- Issues: https://github.com/hellocoop/cdk-client/issues
- npm.io page: https://npm.io/package/@hellocoop/cdk-client

## Dependencies (2)

- [aws-cdk-lib](https://npm.io/package/aws-cdk-lib.md) ^2.130.0
- [@aws-sdk/client-lambda](https://npm.io/package/@aws-sdk/client-lambda.md) ^3.533.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 2.9.0 (latest) — 2026-07-16
- 2.8.8-canary.0 (canary) — 2025-12-15
- 2.8.8 — 2025-12-15
- 2.8.7 — 2025-12-13
- 2.8.6-canary.3 — 2025-12-13
- 2.8.6-canary.2 — 2025-12-13
- 2.8.6-canary.0 — 2025-12-13
- 2.8.5 — 2025-12-13
- 2.8.1 — 2025-10-08
- 2.8.0 — 2025-10-07
- 2.7.4 — 2025-09-04
- 2.7.4-canary.0 — 2025-09-04
- 2.7.3 — 2025-08-15
- 2.7.2 — 2025-02-04
- 2.7.1 — 2025-01-29
- … 103 more at https://npm.io/package/@hellocoop/cdk-client/versions

## README

# @hellocoop/cdk-client

A Hellō Client CDK Construct for a Lambda Function

## Quickstart

```sh
npm install @hellocoop/cdk-client
```

```TypeScript
import { HelloClientConstruct, Scope, ProviderHint  } from '@hellocoop/cdk-client'

// Create the Hello Client Lambda and functionUrl
const helloClient = new HelloClientConstruct(this, 'HelloClient', {
    clientID: CLIENT_ID,    // required = your Hellō client_id from https://console.hello.coop
    hostname: HOSTNAME,     // recommended - public hostname 

    // Optional parameters:
    //
    cookieToken?: boolean; 
    // - Set to true to enable if a cookie token is returned in the op=auth response
    //   Must be true if using the authorizer for API Gateway - see below
    loginSyncFunctionName?: string; 
    // - Name of the lambda function to trigger on login - ARN is built from current region and account
    loginSyncFunctionArn?: string;
    // - Full ARN of the lambda function to trigger on login - use if lambda is in another region or account
    providerHints?: ProviderHint[]; 
    // - Override default providers to show to new users. See https://www.hello.dev/docs/apis/wallet/#provider_hint
    scopes?: Scope[]; 
    // - Override default array of scopes to request from the user. See https://www.hello.dev/docs/scopes/
    functionName?: string; 
    // - Override default function name 'HelloClient'
    route?: string; 
    // - Override default route (/api/hellocoop)
    sameSiteStrict?: boolean; 
    // - Set to true to enable SameSite attribute to Strict
    logDebug?: boolean;
    // - Set to true to enable debug logging
    helloDomain?: string;
    // - Set to hello-beta.net to use the Hellō Beta service - note this is NOT stable!
});

// add Hello Client Lambda origin as a behavior to a Cloud Front Distribution
distribution.addBehavior(HELLO_API_ROUTE, new origins.FunctionUrlOrigin(helloClient.functionUrl), {
    viewerProtocolPolicy: cf.ViewerProtocolPolicy.HTTPS_ONLY,
    allowedMethods: cf.AllowedMethods.ALLOW_ALL,
    cachePolicy: cf.CachePolicy.CACHING_DISABLED,
    originRequestPolicy: new cf.OriginRequestPolicy(this, 'hellocoop', {
        queryStringBehavior: cf.OriginRequestQueryStringBehavior.all(),
        cookieBehavior: cf.OriginRequestCookieBehavior.all(),
    }),
});

```

## loginSyncFunction

You provide this Lambda to be called on successful login. It is passed:

```json
{
    "token": "ey ... ID Token for independent verification ...",
    "payload": {
        "iss": "https://issuer.hello.coop",
        "aud": "2000a054-aa09-45a3-9f62-26e03ee9dc76",
        "nonce": "4a6fc9b2-0f47-4105-a367-b9ae0ca12784",
        "jti": "jti_MUYT099WI3g0h7MDiRuVMhHA_c7g",
        "sub": "66752aed-9cc2-4d17-875f-379b1a578f9a",
        "name": "Dick Hardt",
        "picture": "https://pictures.hello.coop/r/eebce734-44c0-4c39-8161-ba77e08091f9.jpeg",
        "email": "dick.hardt@gmail.com",
        "email_verified": true,
        "iat": 1727210134,
        "exp": 1727210434
    }
}
```

You can then 
- create a user if they don't exist
- run a policy and deny access
- change what is returned by auth
- change the path where the user will be redirected

All of the properties are optional:

```json
{  
    "accessDenied": true,           // will deny access
    "updatedAuth": {                // will update what is returned by the auth operation
        "role":"admin"
    },
    "target_uri": "/new_location"   // path to send user when complete
}
```


## Client Usage

See TBD for details

### Login
`/api/hellocoop?op=login`

### Logout
`/api/hellocoop?op=logout`

### Get Auth
`/api/hellocoop?op=auth`

## Sample

See [client-sample-stack.ts](cdk-sample/lib/client-sample-stack.ts) in [cdk-sample](cdk-sample)

---
_Source: https://npm.io/package/@hellocoop/cdk-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
