amplitude / amplitude/Amplitude-TypeScript

Ability to add custom identity storage provider in @amplitude/analytics-browser@v2.0.0

Aberta
#448 6 comentários 1 reação 0 responsáveis Ver no GitHub
enhancement
Linguagem predominante
TypeScript
Estrelas
180
Forks
68
Merge médio
3d 1h
PRs com merge (30d)
29

Descrição

## Summary
The `cookieStorageProvider` property was removed in v2.0.0 of the Browser SDK, so this blocks us from being able to specify a custom storage provider for GDPR compliance purposes. It would be amazing if the SDK provided this type of functionality out of the box (e.g. `switchIdentityStorage`) or added a `custom` option to `identityStorage` so folks can provide custom storage providers again.

## Motivations
For GDPR compliance, we would like to track users using memory storage and then switch to cookies only after users have provided their consent to use tracking cookies. We were able to do this in `@amplitude/analytics-browser@v1.0.0` by creating a custom `Storage` instance (https://github.com/MystenLabs/sui/blob/main/apps/core/src/utils/persistableStorage.ts) and using that for the `cookieStorageProvider` property. We're aware of the default recommended solution of deferring the initialization of Amplitude until users have provided consent, but that isn't quite the same and we miss out on potentially useful insights.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.