Getting particles to follow a path set in code

Hi! I’m just starting a project where I’m aiming to have a particle system follow a path I generate using code. I know the framework of my code in Javascript/how to implement the path I want to create, but I’m not sure how to implement this in Unity. How do I get a particle system to follow a path set by some code? I feel like a simple case would be to draw a square in some sort of code and have a particle system folow it.