You can find the binaries for wal2json here: https://www.striim.com/docs/smsgc/en/smsgc-how-to-guides/postgresql-to-google-cloud-postgresql-migration-guide/set-up-the-postgresql-source.html
(They're provided by a third-party, Striim, but the company appears legit, so I'm not concerned by it.)
After downloading, copy the dll file into the C:\Program Files\PostgreSQL\VERSION\lib
folder, and restart PostgreSQL.
EDIT: Actually, on attempting to use the wal2json extension from NodeJS, it appears something is incompatible between the prebuilt Windows 10 binary above, and my Postgres install. I get the following error in Postgraphile:
Could not Initiate PgLDSSourcePlugin, continuing without LDS live queries. Error: Couldn't create replication slot, seems you don't have wal2json installed? Error: could not load library "C:/Program Files/PostgreSQL/13/lib/wal2json.dll": The specified procedure could not be found.
So in the end I had to compile the dll myself, as the wal2json readme specifies. (I was getting a compilation error, so I tried upgrading Visual Studio from 2015 to 2019. Once I did so, the build completed easily however. I just opened the wal2json.vcxproj
file, pressed Build->Build wal2json
, then copied the dll file it produced into the PostgreSQL lib
folder.)