# Send custom params from auth0-spa-js loginWithRedirect() for using in rules

**URL:** <https://community.auth0.com/t/send-custom-params-from-auth0-spa-js-loginwithredirect-for-using-in-rules/63686>\
**Category:** Get Help\
**Tags:** auth0-spa-js, rules, query-parameters, custom-param\
**Created:** [June 1, 2021, 3:11pm UTC](https://community.auth0.com/t/send-custom-params-from-auth0-spa-js-loginwithredirect-for-using-in-rules/63686 "2021-06-01T15:11:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pratikpalse](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pratikpalse/32/25096_2.png) [@pratikpalse](https://community.auth0.com/u/pratikpalse)\
**Post date:** [June 1, 2021, 3:11pm UTC](https://community.auth0.com/t/send-custom-params-from-auth0-spa-js-loginwithredirect-for-using-in-rules/63686/1 "2021-06-01T15:11:38Z")

</div>

Dear Community,

I’m developing reactJS app using auth0-spa-js. I want to pass custom params through the loginWithRedirect() function and use same in rules to implement some custom logic.

Params:  
roleID uuid  
venue uuid

Which SDK this is regarding: auth0-spa-js

Is this the right format to do so?

in auth0-spa-js  
\<Button type=‘primary’ onClick={() =\> loginWithRedirect([‘passID’ : passID, ‘venue’ :venue])}\> Log In

in Rules  
const [passID, venue] = JSON.Parse(context.request.query)

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 2, 2021, 9:33pm UTC](https://community.auth0.com/t/send-custom-params-from-auth0-spa-js-loginwithredirect-for-using-in-rules/63686/3 "2021-06-02T21:33:01Z")

</div>

Hi @pratikpalse,

Welcome to the Community!

You need to pass an object. (`{}`) to the `loginWithRedirect()` method. You are currently passing an array (`[]`).

For example:

```auto
loginWithRedirect({foo:'bar'})
```

---

<div class="post-metadata">

**Author:** ![pratikpalse](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pratikpalse/32/25096_2.png) [@pratikpalse](https://community.auth0.com/u/pratikpalse)\
**Post date:** [June 4, 2021, 2:42am UTC](https://community.auth0.com/t/send-custom-params-from-auth0-spa-js-loginwithredirect-for-using-in-rules/63686/4 "2021-06-04T02:42:59Z")

</div>

Okay got it. Please confirm how to use these params inside Rules.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 4, 2021, 5:56pm UTC](https://community.auth0.com/t/send-custom-params-from-auth0-spa-js-loginwithredirect-for-using-in-rules/63686/5 "2021-06-04T17:56:30Z")

</div>

They are available in `context.request.query`.

Have you tried it?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 19, 2021, 5:56pm UTC](https://community.auth0.com/t/send-custom-params-from-auth0-spa-js-loginwithredirect-for-using-in-rules/63686/6 "2021-06-19T17:56:32Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
