diff --git a/lib/config.go b/lib/config.go index 7a9419aa50..e2a56c1375 100644 --- a/lib/config.go +++ b/lib/config.go @@ -392,6 +392,20 @@ func WithHeaders(headers []string) NucleiSDKOptions { } } +// WithVars allows setting custom variables to use in templates/workflows context +func WithVars(vars []string) NucleiSDKOptions { + // Create a goflags.RuntimeMap + runtimeVars := goflags.RuntimeMap{} + for _, v := range vars { + runtimeVars.Set(v) + } + + return func(e *NucleiEngine) error { + e.opts.Vars = runtimeVars + return nil + } +} + // EnablePassiveMode allows enabling passive HTTP response processing mode func EnablePassiveMode() NucleiSDKOptions { return func(e *NucleiEngine) error {