How do I create a plugin that adds a property to the client object?
Consider the
magic-link
plugin. When we register it, we get access to client.magicLink.verify()
. How do I create my own plugin that does so? I read the source code of this plugin but didn't find anything useful. Thanks.Solution:Jump to solution
magic-link ->
magicLink
, and verify is just verify
, so together in the authClient it would be authClient.magicLink.verify
6 Replies
This is possible because of the
$inferServerPlugin
, which looks at all of the endpoints defined in the server plugin
But, the server just registered routes. Nowhere does it register
.verify()
method.
@PingIt's inferred from the path

Solution
magic-link ->
magicLink
, and verify is just verify
, so together in the authClient it would be authClient.magicLink.verify
Oooo
Cool
Thanks 😊
Sure, no worries