this is the best example code I've found for custom recipes. and no. custom recipes are not locked to items. it's not to hard to pull a string out of the json object. those can easily be turned into a resource location or whatever else you need.
I've been working on a magic mod and had a similar problem my (untested) solution was to use a custom damagesource to store what I needed and send it upstream.
edit: finally did some testing worked fine.