Auth0 Home Blog Docs

Postgres connection in a rule and/or hooks?



Hello !

I’m trying to access our postgres database via a rule, but it seems like this is not supported?

When I try to copy/paste from the custom database connection template code, I get an error “postgres is not defined” in the code editor, though there are some templates for sqlserver.

I have the same issue with the hooks, which would be more appropriate as I need to do something after sign up.

Any advice ?


You will need to require the modules that you need in your Rule. You can see a list of available modules here:


var mysql = require('mysql@2.6.2');
.... rule code