# Context propagation for Typescript SDK

**URL:** <https://community.temporal.io/t/context-propagation-for-typescript-sdk/6708>\
**Category:** Community Support\
**Tags:** general-impl, context-propagators, typescript-sdk\
**Created:** [December 12, 2022, 4:17pm UTC](https://community.temporal.io/t/context-propagation-for-typescript-sdk/6708 "2022-12-12T16:17:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rifruf](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/rifruf/32/2121_2.png) [@rifruf](https://community.temporal.io/u/rifruf)\
**Post date:** [December 12, 2022, 4:17pm UTC](https://community.temporal.io/t/context-propagation-for-typescript-sdk/6708/1 "2022-12-12T16:17:13Z")

</div>

Hello, using Temporal’s Typescript SDK (v.1.4.3). Want to start propagating context through all of my workflows so that I know how to attribute which workflows/activities are being used by which users within my teams (for the sake of cost analysis).

Was curious how it’s suggested to do so, I see some docs here ([Logging and Sinks in TypeScript SDK | Temporal Documentation](https://docs.temporal.io/typescript/logging#context-propagation)), but there’s not much examples I could find of how to do what I’m trying to do. Also found this forum post ([Context Propagation docs - #2 by bergundy](https://community.temporal.io/t/context-propagation-docs/6400/2)), which seems to suggest using interceptors instead of the propagators from the first link. What’s the best approach for my use case here? Are there any code samples that might help with understanding this? Thanks!

---

<div class="post-metadata">

**Author:** ![bergundy](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/bergundy/32/900_2.png) [@bergundy](https://community.temporal.io/u/bergundy)\
**Post date:** [December 12, 2022, 10:50pm UTC](https://community.temporal.io/t/context-propagation-for-typescript-sdk/6708/2 "2022-12-12T22:50:05Z")

</div>

The docs you saw on logging and sinks mention opentelemetry context propagation.  
If you want to propagate context that’s not tied to tracing, you would need to implement your own interceptors, as I mentioned in [Context Propagation docs - #2](https://community.temporal.io/t/context-propagation-docs/6400/2).

---

<div class="post-metadata">

**Author:** ![rifruf](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/rifruf/32/2121_2.png) [@rifruf](https://community.temporal.io/u/rifruf)\
**Post date:** [December 12, 2022, 11:03pm UTC](https://community.temporal.io/t/context-propagation-for-typescript-sdk/6708/3 "2022-12-12T23:03:54Z")

</div>

Thanks for the reply. Not sure I understand, how do I differentiate between context tied to tracing vs context not tied to tracing? From what I can tell, I would want to write my own interceptor then, since the context I’m trying to propagate is related to who might be starting the workflow. Is that correct?

---

<div class="post-metadata">

**Author:** ![bergundy](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/bergundy/32/900_2.png) [@bergundy](https://community.temporal.io/u/bergundy)\
**Post date:** [December 12, 2022, 11:22pm UTC](https://community.temporal.io/t/context-propagation-for-typescript-sdk/6708/4 "2022-12-12T23:22:04Z")

</div>

Yes, that is correct.

---

<div class="post-metadata">

**Author:** ![rifruf](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/rifruf/32/2121_2.png) [@rifruf](https://community.temporal.io/u/rifruf)\
**Post date:** [December 12, 2022, 11:36pm UTC](https://community.temporal.io/t/context-propagation-for-typescript-sdk/6708/5 "2022-12-12T23:36:50Z")

</div>

Gotcha. If I’m to do this via interceptors, what’s the use case for the propagators linked in the Logging and Sinks page?

---

<div class="post-metadata">

**Author:** ![bergundy](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/bergundy/32/900_2.png) [@bergundy](https://community.temporal.io/u/bergundy)\
**Post date:** [December 14, 2022, 1:15am UTC](https://community.temporal.io/t/context-propagation-for-typescript-sdk/6708/6 "2022-12-14T01:15:44Z")

</div>

See the opentelemetry docs here: [Propagators API | OpenTelemetry](https://opentelemetry.io/docs/reference/specification/context/api-propagators/)
