# getToken for Flows not working

**URL:** <https://community.homey.app/t/gettoken-for-flows-not-working/73834>\
**Category:** Developers\
**Created:** [December 19, 2022, 1:06pm UTC](https://community.homey.app/t/gettoken-for-flows-not-working/73834 "2022-12-19T13:06:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neil\_Alford](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/neil_alford/32/37373_2.png) [@Neil\_Alford](https://community.homey.app/u/Neil_Alford)\
**Post date:** [December 19, 2022, 1:06pm UTC](https://community.homey.app/t/gettoken-for-flows-not-working/73834/1 "2022-12-19T13:06:20Z")

</div>

I have been trying to use the getToken function but it fails with the error:

“Unable to initialize app TypeError: this.homey.flow.getToken is not a function”

I have created a very simple test case:

```
async onInit() {
    this.homey.flow.createToken('tomorrowsBestPrice', { type: 'string', title: 'Best export price', value: 0 });
    const token = this.homey.flow.getToken('tomorrowsBestPrice');
}

```

But even this fails when calling getToken, maybe I’m missing something obvious but I can’t see why this doesn’t work, does anyone have any suggestions? The SDK documentation seems to suggest that this should work [ManagerFlow - Homey Apps SDK v3](https://apps-sdk-v3.developer.homey.app/ManagerFlow.html) and the various other functions for getting flow cards seem to work fine.

Previously I was getting round this by just storing the token returned by the createToken function but after some restructuring of my code it would be easier if I could use getToken.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [December 19, 2022, 1:13pm UTC](https://community.homey.app/t/gettoken-for-flows-not-working/73834/2 "2022-12-19T13:13:04Z")

</div>

Doesn’t seem to be implemented despite what the documentation states.

Issue created: [`this.homey.flow.getToken` is not a function · Issue #277 · athombv/homey-apps-sdk-issues · GitHub](https://github.com/athombv/homey-apps-sdk-issues/issues/277)

---

<div class="post-metadata">

**Author:** ![Neil\_Alford](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/neil_alford/32/37373_2.png) [@Neil\_Alford](https://community.homey.app/u/Neil_Alford)\
**Post date:** [December 19, 2022, 1:19pm UTC](https://community.homey.app/t/gettoken-for-flows-not-working/73834/3 "2022-12-19T13:19:34Z")

</div>

Well, that would explain that! Assumed I was missing something obvious, but good to know it’s not just me being dim.

Guess I’ll have to rework my code to continue using the token returned by the createToken function.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [December 19, 2022, 1:23pm UTC](https://community.homey.app/t/gettoken-for-flows-not-working/73834/4 "2022-12-19T13:23:19Z")

</div>

It should exist though. See Github issue.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [December 19, 2022, 1:47pm UTC](https://community.homey.app/t/gettoken-for-flows-not-working/73834/5 "2022-12-19T13:47:30Z")

</div>

Apparently this got fixed in 8.1.1
